Wrong permissions when uploading file on WORDPRESS (Windows server 2012) Wrong permissions when uploading file on WORDPRESS (Windows server 2012) wordpress wordpress

Wrong permissions when uploading file on WORDPRESS (Windows server 2012)


When you upload a file, PHP sends the file to a temporary directory on your server's hard drive (usually C:\Windows\Temp) and then copies it over to the proper directory. Once the file has is initially put in the temporary directory, it gets the permissions of that directory. The problem is when Windows moves that file to the proper place, it keeps the temporary directory’s permissions, which can cause access problems.

The way to fix this is to change the temporary directory to a folder within your WordPress installation, usually wp-content/upgrade.

To do this, follow these directions:

Find your php.ini file.Find the upload_tmp_dir line, and change it to the wp-content/upgrade folder.Browse to this folder and verify that the permissions are set properly.You should then have the ability to properly view all your images. You'll most likely need to select all the previous selected images, and change the owner of the files to the web folder owner. Then you should be good to go!


If you can’t upload an image at all, it’s probably because you need to give the IUSR account Read/Write/Modify permission on your wp-content folder. This will allow you to upload, and do the WordPress & plugin updates.

Once you have done that, all you need to do is give the IIS_IUSRS group Read permissions on your “C:\Windows\Temp” folder.

Make sure to notice that the two permission changes you make are not for the same user/group. Give IUSR permissions on your wp-content folder and IIS_IUSRS permissions on your Windows temp folder.

Note: If you have edited your php.ini file and change the upload temp directory then you will need to give IIS_IUSRS group read permissions on that folder instead.

That should do it, or at least it worked for me.

http://chris.wastedhalo.com/2011/01/wordpress-upload-permissions-on-iis-7-fix/


I find myself coming back to this question time after time when images I add to the Media Gallery don't have the correct permissions in the WordPress Uploads folder. Since I develop WordPress sites locally, it would be a pain to set permission on the Uploads folder every time I work on a new site.

To fix this, I created a folder "C:\Websites\Temp" without messing around with permissions or security settings, etc. Then in MAMP, I edited the php.ini template of the PHP version I was using for this site, php7.3.0.ini (File, Edit Tempate, PHP). I then set upload_tmp_dir to "C:\Websites\Temp":

; Temporary directory for HTTP uploaded files (will use system default if not; specified).upload_tmp_dir = c:\websites\temp

and voila, no more permission issues.