Click here to Skip to main content
11,799,282 members (76,722 online)
Rate this: bad
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 5:15am
Edited 1-May-13 5:18am
(no name)34.1K
ryanb31 at 1-May-13 11:30am
So, IDM is giving you an error? What if you turn that off?
NguyenVanDuc at 1-May-13 12:04pm
the download file will not work again.
Bernhard Hiller at 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
0 OriginalGriff 473
1 CPallini 410
2 Richard MacCutchan 319
3 phil.o 244
4 Kornfeld Eliyahu Peter 205
0 OriginalGriff 2,475
1 Maciej Los 1,860
2 KrunalRohit 1,496
3 CPallini 1,465
4 Richard MacCutchan 1,149

Advertise | Privacy | Mobile
Web02 | 2.8.151002.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