iis7+php upload image successfully but cannot access 401.3

Source: Internet
Author: User

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:
    1. Set a temporary directory for the Upload_tmp_dir item in php.ini and do the appropriate permissions (recommended method)
    2. 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.