0

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

EkoostikMartin
  • 6,831
  • 2
  • 33
  • 62
Er Mayank
  • 1,017
  • 2
  • 16
  • 39

1 Answers1

0

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)

Community
  • 1
  • 1
Aristos
  • 66,005
  • 16
  • 114
  • 150
  • 1
    but my files are in different folder named Docs. And EveryOne have that link of Docs. How to protect that Docs folder from being accessed by unauthorized users? – Er Mayank May 15 '14 at 20:45
  • @ErMayank Remove the permissions from the web users, keep the permissions of the pool. See how here: http://stackoverflow.com/questions/16677887/how-to-set-correct-file-permissions-for-asp-net-on-iis/16678016#16678016 And you can simple moves them. If you do not have design that from the beginning, change your design now. – Aristos May 15 '14 at 20:46
  • @ErMayank Ok, if you use a handler then they can not know where you take them from. – Aristos May 15 '14 at 20:52