Hey everybody. I keep getting this permission denied error (below) every time I attempt to upload an image. Have scoured via Google and rechecked my permissions ad nauseum. The following users have full control of the files in my website root directory, which is running on IIS 6.0.

IIS_WPG (mydomain\IIS_WPG)
Internet Guest Account (mydomain\IUSR_mydomain)

Here is my error:
warning: copy(c:\Inetpub\wwwroot\files) [function.copy]: failed to open stream: Permission denied in c:\Inetpub\wwwroot\includes\file.inc on line 374.

The selected file c:\Inetpub\wwwroot\files could not be copied.

Here is line 374 from File.inc
if (!@copy($source, $dest)) {
drupal_set_message(t('The selected file %file could not be copied.', array('%file' => theme('placeholder', $source))), 'error');
return 0;
}

This is really puzzling, as all of the permissions appear to be correct. Am very much appreciative of any help. Thank you in advance.

Comments

derektut’s picture

Also, if my permissions are correct, is there a way to rebuild the files directory through Drupal without completely reinstalling? Thanks, again.

RobRoy’s picture

I've posted a patch for Drupal 4.7 at http://drupal.org/node/91624 which may relate to this bug on Windows when magic_quotes_gpc is left On. Please review it if you can.

--
Rob
Founder and Director
Electronic Insight Corporation

Recent Drupal Projects: MP3PIG | MySpace Layouts

deqn’s picture

Hi,
i've been facing the same problem, the fix suggested didn't work for me,neither the permissions, even if i give full to everyone.

i on't know what to try even, do you have any more ideas?
thanks

i'm on win2003, iis6, php5,

deqn’s picture

i've just managed to make it work by giving internet guest account to c:\windows\temp foder and all it's sub files and folders.

even that it works i'm not sure whether it is not a hack-around sollution that makes the system more open for attaks, so please advice

thanks!

Joe One’s picture

Hi Deqn,

did you had any luck finding a solution for the c:\windows\temp upload problem?

regards,

Joe

Steve cousins’s picture

Create a 'temp' (e.g. C:\inetpub\wwwroot\drupal\temp) folder in your drupal folder and set Administer/Site configuration/File system/Temporary directory to use that. A lot more secure that giving IUSR permissions to the windows dir.