Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

Music File Download Restriction

images php coding issues or problems here.

Moderators: macek, egami, gesf

Music File Download Restriction

Postby santu143us » Wed Jun 22, 2005 4:22 am

Hi,
I am presently working on a project which is basiaclly a Music Forum. The Forums include downloading MP3 files. Only a Registered user can able to download so. But even a non-member will be able to copy shortcut and download the File. How to restrict this ?

For eg...

I will be able to download a MP3 file say
http://test.com/test/test.mp3 ( only when I logged in).

But directly typed in browser
http://test.com/test/test.mp3 should be restricted ....

How to achieve this?

Thanks in advance,
santhosh
santu143us
New php-forum User
New php-forum User
 
Posts: 3
Joined: Wed Jun 22, 2005 4:20 am

Postby Alexej Kubarev » Wed Jun 22, 2005 4:55 am

possibly you will have to use .htaccess (restrincting access to the file via browser)
and when user clicks on download, read the file with php and force-download it :)
the link might have to be something like donwload.php?id=2332556

where id corresponds to that file... or maybe download.php?file=test.mp3

its up to you to decide..
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län


Return to PHP coding => Images

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron