asp question about text file

Discussion in 'ASP General' started by Danny, Dec 11, 2004.

  1. Danny

    Danny Guest

    I wrote an asp program that displays some information line by line such as
    name, address, town, state, zip

    and it prints about 200 lines to their browsers when the asp file is called.
    It is comma delimted so they can import into their database using access for
    example.

    1. when they do file-save as to a txt file, it does not import right for
    them. It seems the lines blend into each other.

    1. the only way they can do it is if they view the source code, then save as
    txt file. then when they import into access, it parses right.

    odd, what can i do on my asp end to make sure they can just do a file save
    as right from browser instead of viewing source.

    Thanks
    Danny, Dec 11, 2004
    #1
    1. Advertising

  2. Danny

    Evertjan. Guest

    Danny wrote on 11 dec 2004 in microsoft.public.inetserver.asp.general:

    > I wrote an asp program that displays some information line by line
    > such as name, address, town, state, zip
    >
    > and it prints about 200 lines to their browsers when the asp file is
    > called. It is comma delimted so they can import into their database
    > using access for example.
    >
    > 1. when they do file-save as to a txt file, it does not import right
    > for them. It seems the lines blend into each other.
    >
    > 1. the only way they can do it is if they view the source code, then
    > save as txt file. then when they import into access, it parses right.
    >
    > odd, what can i do on my asp end to make sure they can just do a file
    > save as right from browser instead of viewing source.


    The simlest way is to enclose the content into <pre> ... </pre>, as an
    ASP file is normally rendered and viewed as a HTML file on the client
    side.

    The second way is to send it as a .txt file

    The third and most sofisticaeted way is to send it as a binary streem
    with a special content-disposition allowing only a "save as".

    Response.AddHeader "Content-Disposition","attachment; filename=" & fn
    <http://www.aspfaq.com/show.asp?id=2161>


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Dec 11, 2004
    #2
    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. BLF
    Replies:
    4
    Views:
    1,274
    Mike Treseler
    Aug 7, 2004
  2. rama
    Replies:
    1
    Views:
    2,530
    Steve C. Orr [MVP, MCSD]
    Nov 12, 2003
  3. Krish
    Replies:
    1
    Views:
    1,073
    =?Utf-8?B?Q3VydF9DIFtNVlBd?=
    Oct 20, 2005
  4. walterbyrd
    Replies:
    7
    Views:
    306
    Asun Friere
    May 17, 2007
  5. leo
    Replies:
    1
    Views:
    272
    Bob Lehmann
    Dec 5, 2005
Loading...

Share This Page