Upload Error
Posted: Mon Jul 19, 2010 8:51 pm
Okay so I'm using some PHP to create an upload script and I got this following error:
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpLZUTH4' to 'http://www.sition.net/upload/resources5558.s2z' in /home2/zack/public_html/includes/do_upload.php on line 29
Here is the code I used.
And here is the HTML form:
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpLZUTH4' to 'http://www.sition.net/upload/resources5558.s2z' in /home2/zack/public_html/includes/do_upload.php on line 29
Here is the code I used.
Code: Select all
<?php
$target = "http://www.sition.net/upload/";
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
if (!($uploaded_type=="s2z")) {
echo "You may only upload s2z or honmod files.<br>";
$ok=0;
}elseif (!($uploaded_type=="honmod")) {
echo "You may only upload s2z or honmod files.<br>";
$ok=0;
}
if ($ok==0) {
echo "Sorry your file was not uploaded";
}
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)){
echo "The file " . basename( $_FILES['uploadedfile']['name']). "has been uploaded";
}else{
echo "Sorry, there was a problem uploading your file.";
}
?> Code: Select all
<form enctype="multipart/form-data" action="http://www.sition.net/includes/do_upload.php" method="POST">Please Choose a file: <input name="uploaded" type="file"/><br/><input type="submit" value="Upload"/></form>