Monday, March 26, 2012

Set filename in IE Save As dialog for download file?

Hi,
I store attachment file in SQL Server database and user can download it
later by using a download page e.g. Download.aspx?FileID=1234, the problem
is Internet Explorer always show default filename is "Download.aspx" in it's
"Save As" dialog box, how can I force it to display original uploaded
filename (which I save in database too)?
thank you,Well, for example:
string disHeader = "Attachment; Filename=\"" + filename + "\"";
Response.AppendHeader("Content-Disposition", disHeader);
/C
Cristoffer Crusell
Use this code:
Response.AddHeader("Content-Disposition", "inline;filename=test.xls")
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Tien" <tiendq@.gmail.com> wrote in message
news:1d72a31c.0501212036.715c9971@.posting.google.com...
> Hi,
> I store attachment file in SQL Server database and user can download it
> later by using a download page e.g. Download.aspx?FileID=1234, the problem
> is Internet Explorer always show default filename is "Download.aspx" in
> it's
> "Save As" dialog box, how can I force it to display original uploaded
> filename (which I save in database too)?
> thank you,

0 comments:

Post a Comment