upload

A

Anonymous

Guest
i keep getting an error on my file upload script.. i cant see to find out what it is... this is the error that i get


File uploaded successfully
Warning: Unable to create '/home/xlord/public_html/hxc/level4/': Is a directory in /home/xlord/public_html/hxc/level4/upload.php on line 5


and here is my code

Code:
<?php

if($_FILES[image] != ""){
   echo" File uploaded successfully";
   copy($_FILES[image][tmp_name], "/home/xlord/public_html/hxc/level4/" . $_FILES[image][NAME]);

}else{
 echo "<FORM METHOD=\"POST\" ACTION=\"$PHP_SELF\" ENCTYPE=\"multipart/form-data\">
       Upload image:<br>
      <INPUT TYPE=\"FILE\" NAME=\"image\"><br>
	  <INPUT TYPE=\"submit\" NAME=\"submit\">
	  </FORM>
";
	    
}
?>
 
make sure the user of the webserver has access to write to that directory.

or change the permissions on that directory to 777 with the chmod command.

also I noticed you need ' ' in your $_FILES array. ex. $_FILES['image']['NAME']
 
well ya i did chmod the dir even the script.. but for some reason its not working.. i still get the same error..

Warning: Unable to create '/hxc/level4/': No such file or directory in /home/xlord/public_html/upload.php on line 6
 
Back
Top