Jyxo\Input\Upload::confirmUpload PHP Méthode

confirmUpload() public méthode

Confirms that the file was successfully uploaded.
public confirmUpload ( ) : self
Résultat self
    public function confirmUpload() : self
    {
        // Isset is just a simple check, it is not sufficient!
        $this->success = isset($_FILES[$this->index]);
        return $this;
    }

Usage Example

Exemple #1
0
 /**
  * Sets that the file fas successfully uploaded.
  *
  * @param \Jyxo\Input\Upload $in Uploaded file
  * @return \Jyxo\Input\Upload
  */
 public function filter($in)
 {
     if (!$this->error && !$this->failedEmpty) {
         $in->confirmUpload();
     }
     return $in;
 }