Response.AddHeader content-disposition

S

S.Kartikeyan

I read previous posts in the group regarding
Response.AddHeader("content-disposition","filename:somefilename");


My aim is to send a file from aspx page with some file name.
when the page is opened in Internet Explorer it should display
the OpenFileDialog asking me to whether to open|save the file.

When i do it and access the page from internet explorer it shows the
DialogBox asking me whether to open or save the file .When i say open
two times ,
the third time i open the page ,Internet Explorer Doesn't show the
dialog and instead displays the text inside like this.

\\Flute\\\Flute\testcase1_audio.wma \\Flute\testcase1_video.wma

My code is like this in FileResponse.aspx page

private void Page_Load(object sender, System.EventArgs e)
{
//Behaviour is not changing by uncommenting the below line.
//Response.ContentType = "text/html";
Response.AddHeader("content-disposition",
"attachment;filename=test.uls");
Response.Output.WriteLine(@"<ulslecture>");
Response.Output.WriteLine(@"<audiourl>\\Flute\testcase1_audio.wma</audiourl>");
Response.Output.WriteLine(@"<videourl>\\Flute\testcase1_video.wma</videourl>");
Response.Output.WriteLine(@"</ulslecture>");
Response.End();

}


What is the problem.
Is the bug in the Internet Explorer
Is there any work around

S.Kartikeyan
 

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,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top