Hello, I tried upload my file but it $this->request->hasFiles() returns false. I tried to dump $_FILES but it returns array(0) { }. Please help me please. This is my code.
<?
if ($this->request->isPost()) {
var_dump($_FILES);
echo "Check if the user has uploaded files";
//var_dump($this->request);
$path = '';
if ($this->request->hasFiles() == true) {
echo "Print the real file names and sizes";
foreach ($this->request->getUploadedFiles() as $file) {
$path = 'files/test/'.$file->getName();
$ext = pathinfo($file->getName(), PATHINFO_EXTENSION);
echo $path;
$file->moveTo($path);
}
}
}
?>