Reputation: 408
public function profilePictureAction()
{
// Check if the user has uploaded files
if ($this->request->hasFiles()) {
// 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/' . $file->getName());
}
}
}
Above is the code using phalcon framework to upload image using form-data. I already test this code with postman but there is a problem. it's output is icon-testing.png 6773 image name and image size but file not uploaded to files folder. already try using full path of my linux ubuntu /var/www/html/myapp/files still can't upload. already chmod 755 files folder and chown :www-data and chown my-username that html folder. If this is because bad permissions I want to know how to solve this. Thank you.
Upvotes: 1
Views: 1845