View Full Version : newbie coding problem

04-19-2004, 06:46 PM
I seem to be having some problems using an upload script i've modified but I keep getting this error:

File Upload Results

Image is a JPG

Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 22072 is not allowed to access /home owned by uid 0 in /home/virtual/site40/fst/home/edward/public_html/process.php on line 46
File could not be stored.

I changed the permissions to 777 but it still gives me problems.. anyone have any ideas?
[you can see what i did by going to edward.infintegrafix.com/upload.html]

04-19-2004, 07:27 PM
Hi, welcome here.. Please read section 2 here: http://www.codingforums.com/postguide.htm

The reason this is happening is becuase move_uploaded_file() checks to see if the script being executed has the same owner as the directory you are about to operate on. (only in safe mode)

What this means is, becuase you do not own the /home directory (this is the directory that contains all the hosting accounts), and safe mode is on, you are being disallowed access... You could try either of these, however i dont know if either will work... If not, you should contact your hosting provider.

copy($_FILES['upload_name']['tmp_name'], "your_directory");

Which may possibly work (replace upload_name with your form value name), but could still bring up a problem. This may also work:

ini_set('upload_tmp_dir', '/folder/on/your/hosting/space');

Place that at the top of your page and then try using the upload script as normal, also ensure you use


to show ALL errors :).