Saving a csv file through ASP.NET

Discussion in 'ASP .Net' started by M. D'Costa, Sep 24, 2004.

  1. M. D'Costa

    M. D'Costa Guest

    Hello,

    I am saving a csv file through an ASP.NET web application. The data is
    obtained from a database and
    saved to the local users machine.

    I am using the Response objects methods of Addheader and ContentType. It
    works fine on my machine to save the file, however on another machine
    browser(Internet Explorer), it prompts to save the aspx page. When I say to
    save the aspx page, it then opens up the 'save dialog box', and saves the
    csv files without any problem.

    I think this is a setting on the browser, where it prompts to save the aspx
    page, any ideas on how to change this?

    Thanks,
    Marise
     
    M. D'Costa, Sep 24, 2004
    #1
    1. Advertising

  2. I believe this should work

    Response.AddHeader("Content-Disposition", filename.csv);
    Response.ContentType = "text/csv";


    "M. D'Costa" wrote:

    > Hello,
    >
    > I am saving a csv file through an ASP.NET web application. The data is
    > obtained from a database and
    > saved to the local users machine.
    >
    > I am using the Response objects methods of Addheader and ContentType. It
    > works fine on my machine to save the file, however on another machine
    > browser(Internet Explorer), it prompts to save the aspx page. When I say to
    > save the aspx page, it then opens up the 'save dialog box', and saves the
    > csv files without any problem.
    >
    > I think this is a setting on the browser, where it prompts to save the aspx
    > page, any ideas on how to change this?
    >
    > Thanks,
    > Marise
    >
    >
    >
    >
     
    =?Utf-8?B?TmVpbA==?=, Sep 24, 2004
    #2
    1. Advertising

  3. Wouldn't it still prompt you though?

    --
    Girish Bharadwaj
    http://msmvps.com/gbvb
    "Neil" <> wrote in message
    news:...
    > I believe this should work
    >
    > Response.AddHeader("Content-Disposition", filename.csv);
    > Response.ContentType = "text/csv";
    >
    >
    > "M. D'Costa" wrote:
    >
    > > Hello,
    > >
    > > I am saving a csv file through an ASP.NET web application. The data is
    > > obtained from a database and
    > > saved to the local users machine.
    > >
    > > I am using the Response objects methods of Addheader and ContentType. It
    > > works fine on my machine to save the file, however on another machine
    > > browser(Internet Explorer), it prompts to save the aspx page. When I say

    to
    > > save the aspx page, it then opens up the 'save dialog box', and saves

    the
    > > csv files without any problem.
    > >
    > > I think this is a setting on the browser, where it prompts to save the

    aspx
    > > page, any ideas on how to change this?
    > >
    > > Thanks,
    > > Marise
    > >
    > >
    > >
    > >
     
    Girish Bharadwaj, Sep 24, 2004
    #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. M. D'Costa
    Replies:
    1
    Views:
    413
    Girish Bharadwaj
    Sep 23, 2004
  2. M. D'Costa

    Issue saving csv file from asp page

    M. D'Costa, Sep 28, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    679
    Hermit Dave
    Sep 28, 2004
  3. Luis Esteban Valencia
    Replies:
    0
    Views:
    2,556
    Luis Esteban Valencia
    Jan 6, 2005
  4. Replies:
    0
    Views:
    393
  5. Tintin92
    Replies:
    1
    Views:
    1,810
    Andrew Thompson
    Feb 14, 2007
Loading...

Share This Page