Link to home
Start Free TrialLog in
Avatar of MOSTAGHASSI
MOSTAGHASSIFlag for United States of America

asked on

Can we perevent downloading file directly on linux with .htaccess?

Hello all,
At the future we want  rent a linux host with apache for music streaming ,is it possible that we prevent downloading file directly from address bar ? suppose all mp3 files are in a dir and its sub dir ,then we like that people listen to music from script and via our player and nobody can type address of file in
address bar  directly like this:

www.mydomain.com/p/hello.mp3

Thanks
SOLUTION
Avatar of ravenpl
ravenpl
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MOSTAGHASSI

ASKER

Thanks, i use mysql+php5  and  a "mp3 player" that is in php page  ,people will click to links and player take address of file/files and play , but the path of file will be access in cashe of opera or other browsers,so with these information do you think that it it easy that i do it without cookies?
Avatar of fifthelement80
fifthelement80

did u try my solution ?
no,because at this time we have coldfusion on windows and as i wrote in my question at the future we want switch to linux and apache so i want to be sure that we don't encounter problem at the future.
I think that, with the path to the MP3 file publicly accessible, you would need to use sessions (and therefore cookies) to check whether the request was coming from a recent visitor or not.