Click here to Skip to main content
15,917,601 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Greetings!!

Are there any solution to disable an download link ( auto generate and enable only in 2 hours).
So public users can not download my upload file.

It's very kind of you for discussing with me.
Thanks !
Posted
Comments
Thomas Daniels 31-Oct-12 8:34am    
What's the root website of the download link?
[no name] 31-Oct-12 8:35am    
Pls provide some more information about your requirement...

One way to do this could be:

1. have the link created for the file to be downloaded.
2. Get the current time-stamp of server encrypt it and put it in the querystring of download link.
3. whenever someone visit decrypt the qurystring and check with current time.
4. if time elapsed is less then 2 hours let him see the page.
5. if not push him to error page.
 
Share this answer
 
Comments
fjdiewornncalwe 31-Oct-12 9:16am    
+5. A very good solution.
Rahul Rajat Singh 31-Oct-12 11:39am    
And the reason i choose this kind of solution is that there is no db needed to keep track of stale n fresh links. I.e. All the state of the link is in the link itself.
NguyenVanDuc 1-Nov-12 12:59pm    
My link was generate only for an customer, nobody else can using this link for saving the download file. And this link is available in 2 hours.
XML
1) You can add following tag in head of aspx page where (content="5") 5 is second of the interval for refreshing the page.
    <meta http-equiv="refresh" content="5">
   so in your case (2*3600) makes 2 hours refresh.
2) If you are adding download link dynamically so on each refresh toggle by viewstate variable and do remove/add of the hyperlink(<a> </a>) part so downloads gets restricted/allowed.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900