View Full Version : Problem with upload script

02-01-2003, 09:10 PM
Hi, I want to create a page which allows users to upload their photos to my server. So I used the following function: copy($photo,$uploaddir) where my $uploaddir looks something like /home/mydomain/mainwebsite_html/photos/

Now a message appears:
Warning: SAFE MODE Restriction in effect. The script whose uid is 558 is not allowed to access /home owned by uid 0 in /home/virtual/site56/fst/var/www/html/reg_form.php on line 38

I have already "CHMOD" the script and directory to 777, but still the same message appears. Can you advise me on how to correct this?

02-02-2003, 08:55 AM

A note on the COPY function on php.net: ## move_uploaded_file Bypasses safe mode and base_dir securities (the function is totally safe, no danger) ##

Here is the function reference:

Note: move_uploaded_file() is not affected by the normal safe mode UID-restrictions. This is not unsafe because move_uploaded_file() only operates on files uploaded via PHP.

Hope it helps