Need help with upload script
Posted: Thu Sep 14, 2006 5:15 pm
I'm trying to write a script that will allow users to upload files on the server, but i get an error mesage that I can't solve the problem for.
The code looks like this:
The form looks like this:
When I run the script I get this error message:
SOMEONE HELP ME PLEASE!!!
The code looks like this:
Code: Select all
result = move_uploaded_file($_FILES['uploadFile']['tmp_name'], "/home/uploads/{$_FILES['uploadFile']['name']}");Code: Select all
<form action="scripts/laddaupp.php" method="post" name="upload" id="upload" enctype="multipart/form-data">
<input type="file" name="uploadFile" /><br />
<input type="submit" name="ok" value="Ladda upp"/>
</form>The messages indicate that the file was uploaded into the tmp-folder but the script fails to move it because of permission problems. I've tried setting all the necessary files and folder permissions to 777 through the FTP-software, but still the same result.Warning: move_uploaded_file(../uploads/lecture13.pdf): failed to open stream: Permission denied in /home/emergosim/scripts/laddaupp.php on line 15
Warning: move_uploaded_file(): Unable to move '/tmp/phpV2TW34' to '../uploads/lecture13.pdf' in /home/emergosim/scripts/laddaupp.php on line 15
SOMEONE HELP ME PLEASE!!!