http://www.nomorepasting.com/paste.php?pasteID=9172
-----------------------------------------------------------------
Hello, Im writing an upload script for 6 pictures, and im getting this error when i try to copy something:
Warning</b>: copy(home/ecliptic/public_html/myface/mkelly09/img_tuto9-01a.jpg): failed to open stream: No such file or directory in <b>/home/ecliptic/public_html/myface/addpicture.php</b> on line <b>147</b><br />
I have no idea why its giving me this error, /home/ecliptic/public_html/mkelly09 exists and is chmodded 777.
Since theres alot of code in that link i gave you, focus in more on lines 145-220 since thats where i use the copy commands.
You will notice that for pic_6 I tried to change it so that it copies to /home/ecliptic/public_html/mkelly09 instead of the others which copy it to /home/ecliptic/public_html/mkelly09/file_name_here
It doesn't work in each case..
any help is appreciated, thanks in advance!
upload script giving copy error
Moderator: General Moderators
-
pootergeist
- Forum Contributor
- Posts: 273
- Joined: Thu Feb 27, 2003 7:22 am
- Location: UK
add / before home - leaving it off will (unless you force base directory) use a relative path.
btw - you should think about iterating a loop for multiple uploads rather than writing the code for every single one
<input type="file" name="upload_file[]" />
<input type="file" name="upload_file[]" />
foreach($_FILES['upload_file']['error'] AS $indx=>$value)
{
if($value == 0)
{
echo $_FILES['upload_file']['tmp_name'][$indx];
}
}
btw - you should think about iterating a loop for multiple uploads rather than writing the code for every single one
<input type="file" name="upload_file[]" />
<input type="file" name="upload_file[]" />
foreach($_FILES['upload_file']['error'] AS $indx=>$value)
{
if($value == 0)
{
echo $_FILES['upload_file']['tmp_name'][$indx];
}
}
-
pootergeist
- Forum Contributor
- Posts: 273
- Joined: Thu Feb 27, 2003 7:22 am
- Location: UK