Scenario 1: No authentication is needed
1) Make .htacess file with the below content
Allow from all Satisfy any
2) After that, put the file to the directory, the following is the result (hierarchy level)
downFolder
yourFileName
.htacess
So everytime the user download the file, they will not be asked for password
Scenario 2: Authentication with Username and Password
1) Make .htacess file with the below content
AuthType Basic AuthName "yourProtectedMsg" AuthUserFile pathOfYourHtapasswdFile Require user loginUsrName
2) After that, make a .htpasswd file from the following URL
http://www.htaccesstools.com/htpasswd-generator/
3) Put .htacess, .htpasswd file to the same directory as your file
downFolder
yourFileName
.htacess
.htpasswd
So everytime the user download the file, they will be asked for password
沒有留言:
張貼留言