I am trying to upload a file from a form and keep getting the following error
failed to open stream: Permission denied
The file is trying to upload an image to a folder that is at a higher level.
E.g. The page is in folder url/cumbria, and is trying to copy the file to url/uplimg
The page calls a function from a seperate function list:
function uploadFile($file,$fileName,$destDir,$overwrite=FALSE) {
$success = FALSE;
if ($file!=""&&$file!="none") {
if(file_exists($destDir.$fileName)) unlink($destDir.$fileName);
$success = TRUE;
$copyPath = $destDir.$fileName;
if (!copy($file, $copyPath)) {
print ("Error: Failed to copy $file...<br>");
$success = FALSE;
}
}
return $success;
}
I tried using"url/uplimg" but i got an error saying the HTTP wrapper would not allow the action.
I also tried it with just "uplimg/" as the destDir and also with the full server path name but both give errors.
Anybody any ideas to help?