Jump to content

Only members can download a file


ballouta

Recommended Posts

store your pdf file names in database and add force download....

 

check for session while downloading whether they are member if they are then proceed with download else redirect them to login page..

 

if($isMember){

// download pdf file retrieved from database

} else {

// redirect them to some other place or any error message that you not allowed to view this

}

I'm attempting to solve a similar problem and with the above code I don't think it will work that way he wants. If people attempt to download it through the site by clicking a link or whatever that will work, but if they just guess the file name, or somebody tells them the file name they can just type:

 

http://www.example.com/files/filename.pdf in their browser and it will allow them to download it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.