I'm currently using the file component in the vork framework to upload a file and I keep getting this error:
Warning: move_uploaded_file(/uploads) [function.move-uploaded-file]: failed to open stream: Permission denied in /var/www/rto-vork/mvc/components/file on line 105
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php3WC6QP' to '/uploads' in /var/www/rto-vork/mvc/components/file on line 105 string(32) "Could not move the uploaded file" success
I believe the component itself is fine, and the uploads directory has already been chmoded to 777
here's the code for the upload the file id is being passed in correctly
public function uploadFile($id, $destination, $imagesOnly = false) {
$return = false;
if (substr($_FILES[$id]['name'], 0, 1) == '.') {
$return = 'File names must not begin with a dot';
} else {
$isInvalidUpload = $this->isInvalidUpload($id, $imagesOnly);
if ($isInvalidUpload) {
$return = $isInvalidUpload;
} else {
if (move_uploaded_file($_FILES[$id]['tmp_name'], $destination)) {
if (is_dir($destination)) {
if ($destination[-1] != '/' && $destination[-1] != '\\') {
$destination .= '/';
}
$destination .= $_FILES[$id]['tmp_name'];
}
chmod($destination, 0777);
} else {
$return = 'Could not move the uploaded file';
}
}
}
return $return;
}