Content-Disposition starts a new session

A

Anonymous Poster

hi,

I'm having a serious issue with the VS 2003 / 1.1 framework and attachments.
If I try to prompt to open/save a file with the following

public void WriteBinaryResponse(HttpResponse aResponse, string aContentType,
byte[] aData, string aDefaultFileName)
{
aResponse.ClearContent();
if (aDefaultFileName != null)
aResponse.AppendHeader("Content-Disposition","attachment;filename=\""+aDefaultFileName+"\"");
aResponse.AppendHeader("Content-Length", aData.Length.ToString());
aResponse.ContentType = aContentType;
aResponse.BinaryWrite(aData);
aResponse.Flush();
aResponse.Close();
}

then on next PostBack, a new Session is created! Can't find any solutions on
google etc. :( Also (randomly) selecting 'open' comes up with 'file not
found'. I read that this can sometimes happen due to caching, but I'm not
setting any cachability on the page...

TIA

Simon
 

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,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top