how to protect or authenticate public data like videos and document files on server?

StackOverflow https://stackoverflow.com/questions/23687914

  •  23-07-2023
  •  | 
  •  

Question

I need to hide the direct link of the files in my site and show download delay of 30 seconds for unRegistered users, Like mediafire and rapidshare do. Is there any way to hide or obfuscate the link of the files doc, pdf,ppt, images and Videos (Most Important), on server (asp).

Was it helpful?

Solution

For start, you place all that files on a protected directory (like the App_Data) and then you use a handler to send them to the registered users.

Inside the handler you can make your checks, if the user is register, if he comes from your site, if the link have time out etc.

For how to make this handler, here is some tutorials, but you can find more if you search.
Simple File Download Protection with ASP.NET
ASP.NET File Download on MSDN

Also you may interesting for this questions/answers:
What is the best way to download file from server
Error handling when downloading file from ASP.NET Web Handler (.ashx)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top