Jump to content

Image Uploading Problem


cmgmyr

Recommended Posts

This is my uploader.php code:[code]global $userid;
    if($file_name !="")
    {
        copy ("$file", "custphotos/gallery".$userid."/$file_name") or die ("Could not copy file");
    }else{
        die("No file specified");
    }[/code]

This is the error that I'm getting:[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Warning: copy(): SAFE MODE Restriction in effect. The script whose uid/gid is 8082/8082 is not allowed to access /mounted-storage/home11/sub002/sc17123-RPXM/www/htdocs/memorial/custphotos/gallery2 owned by uid/gid 99/99 in /mounted-storage/home11/sub002/sc17123-RPXM/www/htdocs/memorial/uploader.php on line 5

Warning: copy(custphotos/gallery2/example.jpg): failed to open stream: No such file or directory in /mounted-storage/home11/sub002/sc17123-RPXM/www/htdocs/memorial/uploader.php on line 5
Could not copy file[/quote]

(Line 5 is the copy command)
The directories are chmod 777.

What is going on and how can I fix this?

Thanks
Link to comment
https://forums.phpfreaks.com/topic/5688-image-uploading-problem/
Share on other sites

[!--quoteo(post=358036:date=Mar 24 2006, 08:14 PM:name=lpxxfaintxx)--][div class=\'quotetop\']QUOTE(lpxxfaintxx @ Mar 24 2006, 08:14 PM) [snapback]358036[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I'm not sure, but maybe your server restricts file uploading?
[/quote]

i've not yet used or looked at 'copy', but have you looked at move_uploaded_file? if it's a conventional upload script via a form, then a conventional method of dealing with it may help.
Link to comment
https://forums.phpfreaks.com/topic/5688-image-uploading-problem/#findComment-20390
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.