CakePHP file upload not found or not readable

I'm afraid now an hour, trying to fix it. I used this to download a file from a directory app/uploads/. He says the directory was not found or not readable. However, I checked it, and there was a file using it $file['File']['filename']. I want to know what is missing here.

$file = $this->File->findById($id);

$extension = pathinfo($file['File']['filename'],PATHINFO_EXTENSION);

$this->response->file('uploads'.DS.$file['File']['filename'], array(
    'download' => true,
    'id'       => $file['File']['filename'],
    'name'     => $file['File']['filename']
));
$this->response->type($extension);
return $this->response;
+2
source share
2 answers

Make sure you don't have another model named File. If so, it seems to be overwriting the cakephp core Utility / File model.

+3
source

"He says the directory was not found or cannot be read."

, , . , -. .

777, , . , , . 777, !

, 755 644 - .

UPDATE: XAMP. . Mac finder, " " . , google " ", , : http://www.wikihow.com/Change-File-Permissions-on-Windows-7

, . , , Cake -.

+1

All Articles