Contenttype with XP sp2

H

Hans

Hi!

I have an asp site where I have com+ components that flushes a tab separated
textfile to the client. Normally the user gets a save as dialog and can save
the file. After installing XP sp2 there seems to be problems. The user will
not be able to download the file (will not see the save as dialog either). I
don't want the document to be presented in the browser.

As it is today I have this code (the sHeader and sBody is a header and sBody
is the actual data). This is not done inside the ASP file it is done in the
COM+ component activated from an asp file.

GetObjectContext("Response").contentType = "application/save"
GetObjectContext("Response").AddHeader "Content-Disposition", "attachement;
filename=export.txt;"
GetObjectContext("Response").Write sHeader & sBody

I have tested setting contentType="text/html" and "text/plain" but this
openes the data in the browser and I need to save the file to disk. I cannot
even use right click and save target as because I have javascript validating
and setting values before the request of the export file is sent.

What I want is the save as dialog to always show.

Regards
/Hans
 
M

Mark Schupp

GetObjectContext("Response").AddHeader "Content-Disposition",
"attachement;

"attachment" is misspelled, s/b

GetObjectContext("Response").AddHeader "Content-Disposition", "attachment;
 
H

Hans

He-he I'm flushing! This code has been out for years (and been working) and
all the time attachment was misspelled. I changed it and it now works on XP
sp2 (I could also get it to work setting an unknown extension for the file
like export.abc).

Thanks Mark!

Regards
/Hans
 

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,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top