0

I have a folder called team1->uploads->upload_file.php file. upload_file.php uploads a file but has to put it in the uploads directory so I was using ../ to go up a folder. File permissions are 700. I have

  move_uploaded_file($_FILES["file"]["tmp_name"],
  "../uploads/".$_FILES["file"]["name"]);

I get the following error:

Warning: move_uploaded_file(../uploads/profile.jpg): failed to open stream: Permission denied in        D:\inetpub\wwwroot\vhosts\cs5339\team1\Produce\upload_file.php on line 31 Warning:     move_uploaded_file(): Unable to move 'C:\Windows\Temp\php938F.tmp' to '../uploads/profile.jpg' in    D:\inetpub\wwwroot\vhosts\cs5339\team1\Produce\upload_file.php on line 31 registered

Anyone know how to fix this? Is there another way to upload files?

wwjdm
  • 2,568
  • 7
  • 32
  • 61
  • Check with your web server configuration, namely related with `move_uploaded_file()` functions, is it is ON or OFF. – samayo May 05 '13 at 16:00

1 Answers1

-1

set permissions to 777 on the uploads folder, you can do that directly on the folder or using php:

chmod("../uploads/", 777);
razz
  • 9,770
  • 7
  • 50
  • 68