The destination directory is given permission to access the
But the newly uploaded image does not inherit the permissions of this directory
Because:
Under the Windows platform, if PHP is using IIS, then PHP uploads the file to a temporary directory (the configuration item can be configured in php.ini "Upload_tmp_dir", because our server has not been configured, So PHP will use the system temp directory "C:\Windows\Temp")
Then PHP will then move the files uploaded in the temporary directory to the directory you specified so there is a problem, that is, the default permissions in the TEMP directory are not the corresponding IIS access permissions (Windows default configuration), When the file is uploaded to the directory by default, the upload file inherits the permissions of the Temp directory, and when PHP then moves the file file to the specified directory, the moved file does not inherit the directory permissions that were moved, resulting in the file being moved from the browser because it does not have the appropriate permissions (IIS Access and unable to access the normal question. The file upload succeeds but "401-Unauthorized: Access is denied due to invalid credentials." "The problem with Windows default permissions configuration
changed permissions configuration (must contain iuser and iis_iusers permissions or everyone) (simply give everyone a read on it)
Workaround:
- Set a temporary directory for the Upload_tmp_dir item in php.ini and do the appropriate permissions (recommended method)
- Add the appropriate permissions to the "C:\Windows\Temp" directory
Important: The php.ini upload_tmp_dir directory permission must contain
Iuser and Iis_iusersPermissions or
Everyone
excerpt from: http://www.cnblogs.com/huangtailang/p/4608175.html
iis7+php upload image successfully but cannot access 401.3