Click here to Skip to main content
13,051,502 members (47,972 online)
Rate this:
Please Sign up or sign in to vote.
See more:


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 31-Oct-12 2:30am
ProgramFOX 31-Oct-12 8:34am
What's the root website of the download link?
snehasish nandy 31-Oct-12 8:35am
Pls provide some more information about your requirement...
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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.
Marcus Kramer 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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 31 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100