Contenttype with XP sp2

Discussion in 'ASP General' started by Hans, Jan 20, 2005.

  1. Hans

    Hans Guest

    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
     
    Hans, Jan 20, 2005
    #1
    1. Advertising

  2. Hans

    Mark Schupp Guest

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

    "attachment" is misspelled, s/b

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


    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com


    "Hans" <> wrote in message
    news:uCK5nAs$...
    > 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
    >
    >
    >
    >
     
    Mark Schupp, Jan 20, 2005
    #2
    1. Advertising

  3. Hans

    Hans Guest

    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
     
    Hans, Jan 21, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. MJ
    Replies:
    3
    Views:
    6,566
  2. alien2_51

    Response.ContentType

    alien2_51, Jun 26, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    777
    alien2_51
    Jun 26, 2003
  3. Sam
    Replies:
    0
    Views:
    461
  4. George
    Replies:
    5
    Views:
    817
    =?Utf-8?B?S2VuIEJlYXJk?=
    Aug 24, 2004
  5. Likhith Areekkal

    Calendars overlap : IE SP2 ; WinXP SP2

    Likhith Areekkal, Dec 23, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    160
    Likhith Areekkal
    Dec 23, 2004
Loading...

Share This Page