Ask about general coding issues or problems here.
Moderators: macek, egami, gesf
by 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>
";
}
?>
-

xlordt
- New php-forum User

-
- Posts: 34
- Joined: Thu Dec 12, 2002 9:00 pm
- Location: NJ
-
by 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']
-

Redcircle
- Moderator

-
- Posts: 830
- Joined: Tue Jan 21, 2003 10:42 pm
- Location: Michigan USA
-
by 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
-

xlordt
- 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: No registered users and 3 guests