Htaccess and downloads

. Htaccess files are not my forte.

I have file uploads to be uploaded / uploaded. The user should be able to view the documents just downloaded by clicking on the document link that appears through ajax after the download is complete.

However, I would like to be able to password protect the / uploads folder, but still enable the current user to view the clicked document without asking for a password.

Can this be done in .htaccess?

Thanks for any suggestions.

+3
source share
3 answers

, .htaccess - .htaccess , . (, uploads/username/), , .htaccess - . , , , .

0

HTTP- , , , .htaccess. , -.

Nginx Lighttpd, X-Accel-Redirect/X-Sendfile. Apache2, mod_xsendfile. /uploads , , - . - ( ), , , .

:

+2

cookie (mod_auth_cookie), htaccess .

, cookie , .

.

EDIT:

+1

Source: https://habr.com/ru/post/1710315/


All Articles