Satyapriya Nayak

Satyapriya Nayak

  • NA
  • 39.3k
  • 13.2m

Prevent users from downloading a file using "direct targeting" URLs?

Apr 20 2010 12:39 PM

Hi!
Well I have always wondered how this is done...how do you actually prevent a user from beeing able to download a file by directly targeting the URL to the file in the adressbar?
Lets for instance say we have the file "File.zip" and its placed in the root directory for a domain called myfiles.com...if we just put the "File.zip"-file directly in the very root, then we would be able to type www.myfiles.com/File.zip and then we would be able to download the file...but how do I prevent that?..is there a way?..cause maybe I just want special users to be able to download that file..
To put it in a more realistic case....lets say we actually have created the above site, but in this case you can actually buy the file "File.zip"...then you only want customers to be able to download it who are register users and preventing people from simply typeing the URL..

Any ideas about how to prevent this?

Thanks in advance!
 

Answers (3)