Hello, I want a script to disallow my site users from downloading those files. Actually, i have created file.php?file=amc.mp3 for playing song in media player but when users with download managers access that page, instead of playing that mp3 their download manager directly catches that file to be downloaded. What i want is to disallow them from download that file, but i want to play that file on my site. Any solution?
I think that it is impossible. You have to "send" file (for playing or not) to client. Nothing can stop him to download it.... Try using flash mp3 player and "hide/mask" real locations for .mp3 file, and for security create .htaccess (hotlik protection).
well, actually the main disturbing thing is download manager. How if it enables user to download but their download managers doesn't catch file from media player on site?
The only thing you can do is make your PHP-script look for the client-name the browser sends, and decide whether to actually send the file or not based on that. It's nowhere near bulletproof, though. I can whip up a PHP-scripts in 3 minutes that downloads a page identifying itself as Internet Explorer 10000.
The only way to do this is to fetch song information from db .. For example, user opens song.php?id=24 ! Frob db : song path, song name .. both depending on this ID .. User will see id=24, but you will play for example my_song.mp3 ( fetch it from db where id = get['id'] ) .. Hope it helps a bit ..
well i tried doing this stuff by setting .htaccess but it then disallowed my own site to read those files. I want somefin that stops other people to download files or at least block download managers from catching the link.
Best bet would be set a flag when they visit the player page, then when they request the mp3, if the flag has expired - don't send the file, otherwise send it. Wouldn't be 100% though, in all honesty you're wasting your time, advanced users could get around it extremely quickly whichever method is used.
you could make a script in php that checks what browser (netscape, firefox, ie, opera...) is using the user, if the user is using one of that then send download page if not using one of that browser probably is using a downloader and then sent nothing
Most downloaders masquerade as a legitimate browser anyway, only the good ones (which follow things like robots.txt anyway) that don't spoof would be stopped, and even then - why would they want the file anyway?
actually the site is about classical singer whose songs are listed on site for listening purpose only. The companies give permission only to allow people for listening of songs thats why i want to make it secure so people couldn't download the songs. anyways thanks for help, i will hot-link protect it and also create a page that hides the link location plus will try to disable download resume feature.