Music File Download Restriction

images php coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 3
Joined: Wed Jun 22, 2005 4:20 am

Music File Download Restriction

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

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 ( only when I logged in).

But directly typed in browser should be restricted ....

How to achieve this?

Thanks in advance,

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

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..

Return to “PHP coding => Images”

Who is online

Users browsing this forum: No registered users and 2 guests