Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

move_uploaded_file error

Status
Not open for further replies.

speedyrudolf

Programmer
Sep 2, 2009
27
RO
Hi. I have the following code:
Code:
$timp=time();
$file_dir="./upload".$timp;
mkdir($file_dir, 0777);
foreach($_FILES as $fisier=>$fisiere)
 {if(is_uploaded_file($fisiere['tmp_name']))
  {move_uploaded_file($fisiere['tmp_name'], "$file_dir/$fisiere[name]");}}
Well...that is just part of the code...Anyway...After I use the form, I get the following error:
Warning: move_uploaded_file() [function.move-uploaded-file]: SAFE MODE Restriction in effect. The script whose uid/gid is 189252/189236 is not allowed to access /home/ owned by uid/gid 81/81 in /home/ on line 9
Does anyone know what the problem is? Thanks you.

PS: line 9 is the last line of code I copied, and I'm using post to submit the form.
 
the upload directory that you have created does not have appropriate permissions set for the php process to access. you should probably set the umask before the mkdir

Code:
$u = umask(0);
mkdir ($file_dir, 0777);
umask($u);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top