Class Phalcon\Http\Request\File

implements Phalcon\Http\Request\FileInterface

Provides OO wrappers to the $_FILES superglobal

  1. <?php
  2. class PostsController extends \Phalcon\Mvc\Controller
  3. {
  4. public function uploadAction()
  5. {
  6. //Check if the user has uploaded files
  7. if ($this->request->hasFiles() == true) {
  8. //Print the real file names and their sizes
  9. foreach ($this->request->getUploadedFiles() as $file){
  10. echo $file->getName(), " ", $file->getSize(), "\n";
  11. }
  12. }
  13. }
  14. }

Methods

public getError ()

public getKey ()

public getExtension ()

public __construct (unknown $file, [unknown $key])

Phalcon\Http\Request\File constructor

public int getSize ()

Returns the file size of the uploaded file

public string getName ()

Returns the real name of the uploaded file

public string getTempName ()

Returns the temporal name of the uploaded file

public string getType ()

Returns the mime type reported by the browser This mime type is not completely secure, use getRealType() instead

public string getRealType ()

Gets the real mime type of the upload file using finfo

public boolean isUploadedFile ()

Checks whether the file has been uploaded via Post.

public boolean moveTo (unknown $destination)

Moves the temporary file to a destination within the application