Jump to content


Photo

Image Uploading Problem


  • Please log in to reply
3 replies to this topic

#1 cmgmyr

cmgmyr
  • Members
  • PipPipPip
  • Advanced Member
  • 1,278 posts
  • LocationUSA

Posted 24 March 2006 - 03:18 PM

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

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

#2 lpxxfaintxx

lpxxfaintxx
  • Members
  • PipPipPip
  • Advanced Member
  • 181 posts

Posted 24 March 2006 - 08:14 PM

I'm not sure, but maybe your server restricts file uploading?

#3 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 24 March 2006 - 09:13 PM

[!--quoteo(post=358036:date=Mar 24 2006, 08:14 PM:name=lpxxfaintxx)--][div class=\'quotetop\']QUOTE(lpxxfaintxx @ Mar 24 2006, 08:14 PM) View Post[/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.

"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#4 cmgmyr

cmgmyr
  • Members
  • PipPipPip
  • Advanced Member
  • 1,278 posts
  • LocationUSA

Posted 27 March 2006 - 03:04 AM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users