Jump to content

Archived

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

cmgmyr

Image Uploading Problem

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
I figured it out...On my server there is a safe mode where I guess it doesn't let you copy files. I just disabled this function and everything works now.

Thanks,
-Chris

Share this post


Link to post
Share on other sites

×

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.