Click here to Skip to main content
11,935,467 members (62,901 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#
i want create a temporary download link:
This is my code:

private void CreateLinkDownloadFile(string strLink)
        // The file path to download.
        string filepath = strLink;//@"C:\shadow_copy.rar";
        // The file name used to save the file to the client's system..
        string filename = Path.GetFileName(filepath);
            System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
            response.ContentType = "application/octet-stream";
            response.AddHeader("Content-Disposition", "attachment; filename=" + filename + ";");
        catch (Exception ex)
and this is error message of IDM:
The web site page instead of a file when IDM requested this file second time. Probably this site uses temporary links and does not allow requesting the same address twice.
Try to delete this download, then start it again from your browser and, when IDM captures it, download it without a stop/pause.
Posted 1-May-13 6:15am
Edited 1-May-13 6:18am
ryanb31 1-May-13 11:30am
So, IDM is giving you an error? What if you turn that off?
NguyenVanDuc 1-May-13 12:04pm
the download file will not work again.
Bernhard Hiller 2-May-13 3:39am
That's exactly the purpose of a temporary download link, isn't it? And you complain that it works as it ought to do???

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.151126.1 | Last Updated 1 May 2013
Copyright © CodeProject, 1999-2015
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