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());
}
}
}
this is my code I upload file using postman with form type: form-data and with image png. In my app directory I already create directory named files after projectname and in one directory with app, public folder. Why this happen? I expecting file copied after I send image data.