标签云

微信群

扫码加入我们

WeChat QR Code

Good day all,I have a folder called documents in my site root, this is password protected by a .htpasswd file, but it is allowed to be accessed by a script to view.how would I allow a script to be able to download the file without accessing it directly from the directory?I'll give an example to explain the situation.on my home page I display the picture test.jpg, this image is in the documents folder that is protected. The image displays correctly on the home page.If type in the address bar www.domain.com/documents/test.jpg it does not display or downloads, but asks for a password.(this I want, but don’t want people to type in a password for each file they want to download)Is there a way that I can make php or JavaScript download the document without ever having to prompt for a password? Other words bypass the .htaccess rule?thanx in advance


The htaccess is processed before any PHP is, so bypassing it is not an option.

2019年04月19日39分31秒