473,395 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Content-Disposition starts a new session

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=\""+aDefaultFile Name+"\"");
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
Nov 27 '06 #1
1 1173
Anyone?? (apologies for double post - msimn screwed up..)

I've since tried the following -

1) Moving the code to do the export to a new web application and using a
webserver caching method to retrieve the report data
2) Saving the document on the server and providing a simple link to the
generated file

Method 1 gets around the 'file not found' issue but the new session problem
remains.
Method 2 seems to allow opening the file to work ok, but saving the file
this time causes the new session bug.

This issue is a obviously a showstopper for our clients!

Simon

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=\""+aDefaultFile Name+"\"");
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

Nov 29 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: jonathan.beckett | last post by:
Hi All, For the past few months I have been working on an open source Apache/PHP/MySQL content management system - and have recently made it available for download. It's still very much a...
0
by: jonathan.beckett | last post by:
Hi All, I have just made version 0.4.8 of the PluggedOut CMS Content Management System available for download - it's free, and covered by the GPL. It's still very much a work in progress...
14
by: j1c | last post by:
How can I remove the content in between tags? I have a page that has several custom tags: <!--tag:1--> Content 1 <!--/tag:1--> <br> <!--tag:2--> Content 2 <!--/tag:2--> <br> <!--tag:3--> Content 3...
1
by: Richard | last post by:
http://dynamicdrive.com/dynamicindex5/linkinfo.htm Using the above script, I have a plan whereby when the main link is active, two different content swaps take place. Column A shows the main...
10
by: clintonG | last post by:
Can somebody direct me to documents or source that supports the use of collapsible content that is collapsed by default when the page is loaded? The secondary objective would of course be...
7
by: Water Cooler v2 | last post by:
I know what it is, and yet the knowledge of what a CMS is, is so vague that I find myself asking this question every now and then. I've googled and read the resources too. However, the knowledge is...
7
by: xkeops | last post by:
Thinking of creating a website, most of the pages will have a general toolbar menu, a content and a footer. The content will be the only one who's gonna change but the rest (header,footer) will...
1
by: dave8421 | last post by:
Hi, I'm trying to make sense of the definition for "Rendered Content" in current CR for CSS 2.1 Is rendered content what is displayed on the particular media or device? from the...
5
by: jessy | last post by:
hi, i have an FreeRTE editor used in my site but whenever i enter something in the TextArea of the editor is not showing in the DB , can anyone tell me what's wrong with my that Piece of Code ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.