I am running a Drupal website on a Windows server using IIS, and whenever I try to upload images using the drupal platform I am getting the following error.

The file php7A42.tmp could not be saved. An unknown error has occurred.
File upload error. Could not move uploaded file.

I have tried the following remedies with no luck
- Changed tmp folder’s location
- Changed permissions of the folders
- Attempted to remove the read-only designation of the folders (Which doesn’t seem to save)
- Changed authentication of IIS to application pool identity

I've tried researching the issue, but unfortunately I haven't found a fix.

Comments

VM’s picture

files are uploaded to tmp then moved to its folder within the files folder as set in image styles or the field config. as a test make tmp 777 and the files folder and all folders under it 777.

please provide path to tmp folder under administration -> file system
please provide information on where tmp folder is in your file system
is there a .htaccess file in the tmp folder?

jeye’s picture

I've attempted to switch permissions of all folders, but this doesn't seem to fix anything. Upon changing permissions within most folders, if I give 777 to Creator / Owner user it never saves that status. It also never saves when I turn read-only mode off. I click apply and close out of settings menu, then when I go back in it is reverted to read-only mode.

There is an htcaccess file in the tmp folder. The contents are as follows...

# Deny all requests from Apache 2.4+.
<IfModule mod_authz_core.c>
  Require all denied
</IfModule>

# Deny all requests from Apache 2.0-2.2.
<IfModule !mod_authz_core.c>
  Deny from all
</IfModule>
# Turn off all options we don't need.
Options -Indexes -ExecCGI -Includes -MultiViews

# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
<Files *>
  # Override the handler again if we're run later in the evaluation list.
  SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
</Files>

# If we know how to do it safely, disable the PHP engine entirely.
<IfModule mod_php5.c>
  php_flag engine off
</IfModule>