How i can upload files to the server???
in the documentation comes:
public function uploadAction()
{
// Check if the user has uploaded files
if ($this->request->hasFiles() == true) {
// Print the real file names and sizes
foreach ($this->request->getUploadedFiles() as $file) {
//Print file details
echo $file->getName(), " ", $file->getSize(), "\n";
//Move the file into the application
$file->moveTo('files/');
}
}
} ```
https://docs.phalcon.io/en/latest/reference/request.html#uploading-files
but $file->moveTo() throws me the error
```php<b>Warning</b>: move_uploaded_file(): The second argument to copy() function cannot be a directory in <b>/var/www/html/phalcon/apps/Inteligob/Controllers/BlobsController.php</b> on line <b>59</b><br />
<br />
<b>Warning</b>: move_uploaded_file(): Unable to move '/tmp/phpeK80pt' to 'upload/' in <b>/var/www/html/phalcon/apps/Inteligob/Controllers/BlobsController.php</b> on line <b>59</b><br />```