Questions about prohibiting direct file access-php Tutorial

Source: Internet
Author: User
The following describes how to prohibit direct access to files: The excelfile is generated in the backend and stored in abtest.xls. I do not want other people to directly enter * .comabtest.xls. if they do not have the permission, they will automatically run and run, what should I do? Prohibit direct access to files
As follows:
Generate an excel file in the background and place it in a/B/test.xls. I do not want others to directly enter http ://*. com/a/B/test.xls. I hope that authorized people can access it. if they do not have the permission, they will automatically run and run. what should I do?

Share:


------ Solution --------------------
The simplest is to save it to a directory other than the web.
------ Solution --------------------
Add a. htaccess file to the same directory as the entry file.
------ Solution --------------------
Use apache permission authentication. Add permissions to this directory.
------ Solution --------------------
Set directory permissions in apache conf

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.