Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

upload

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

upload

Postby xlordt » Tue Jan 21, 2003 8:06 pm

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: Select all


<?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>
";
      
}
?>      

User avatar
xlordt
New php-forum User
New php-forum User
 
Posts: 34
Joined: Thu Dec 12, 2002 9:00 pm
Location: NJ

Postby Redcircle » Tue Jan 21, 2003 11:49 pm

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']
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby xlordt » Wed Jan 22, 2003 10:18 am

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
User avatar
xlordt
New php-forum User
New php-forum User
 
Posts: 34
Joined: Thu Dec 12, 2002 9:00 pm
Location: NJ


Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.