How to get an uploaded file directly

$this->request->getUploadedFiles() return an array of all uploaded file. Is there any clean way to access an uploaded file using its field name. It seems there is not method similar to: $this->request->getUploadedFile('avatar');


As you say, it returns an array ( ): the problem is that is an array of Files ( ). So, unless it is changed, you should create your own function that searchs for the specific file.


Finally I used the following to access a single file: $file=new Phalcon\Http\Request\File($_FILES[$fieldName]); IMHO $this->request->hasFile($fileName) and $this->request->getFile($fileNmae) should be added to Phalcon\Http\Request.