Set filename in IE Save As dialog for download file?

T

Tien

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,
 
G

Guten

Well, for example:

string disHeader = "Attachment; Filename=\"" + filename + "\"";
Response.AppendHeader("Content-Disposition", disHeader);
/C

Cristoffer Crusell
 
S

Steve C. Orr [MVP, MCSD]

Use this code:
Response.AddHeader("Content-Disposition", "inline;filename=test.xls")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top