click to download

Discussion in 'ASP General' started by Guest, Apr 8, 2007.

  1. Guest

    Guest Guest

    Can I have this function?
    When a user click on a link, my ASP page generates a text file call test.txt
    containing a string of "This ia s test msg.", and then a download dialogue
    appears.
    Any reference for me?
    Thanks in advance.
    Guest, Apr 8, 2007
    #1
    1. Advertising

  2. <Elliot> wrote in message
    news:...
    > Can I have this function?
    > When a user click on a link, my ASP page generates a text file call

    test.txt
    > containing a string of "This ia s test msg.", and then a download dialogue
    > appears.
    > Any reference for me?
    > Thanks in advance.
    >


    How's this:-

    <%
    Response.CodePage = 950 ' Change to prefered codepage
    Response.ContentType = "text/plain"
    Response.CharSet = "big5" 'Change to Charset matching codepage
    Response.AddHeader "attachment; filename=test.txt"
    Response.Write "This is a test msg"
    %>
    Anthony Jones, Apr 8, 2007
    #2
    1. Advertising

  3. Guest

    Guest Guest

    Anthony, thanks a lot for your help.
    I have tried it by adding your code to my empty ASP file, however, it
    displayed an error 500 page. Did I do something wrong?

    "Anthony Jones" <> wrote in message
    news:uL#...
    >
    > <Elliot> wrote in message
    > news:...
    >> Can I have this function?
    >> When a user click on a link, my ASP page generates a text file call

    > test.txt
    >> containing a string of "This ia s test msg.", and then a download
    >> dialogue
    >> appears.
    >> Any reference for me?
    >> Thanks in advance.
    >>

    >
    > How's this:-
    >
    > <%
    > Response.CodePage = 950 ' Change to prefered codepage
    > Response.ContentType = "text/plain"
    > Response.CharSet = "big5" 'Change to Charset matching codepage
    > Response.AddHeader "attachment; filename=test.txt"
    > Response.Write "This is a test msg"
    > %>
    >
    >
    >
    Guest, Apr 8, 2007
    #3
  4. <Elliot> wrote in message
    news:...
    > Anthony, thanks a lot for your help.
    > I have tried it by adding your code to my empty ASP file, however, it
    > displayed an error 500 page. Did I do something wrong?


    IIS5 (Win2000) or IIS6 (Win2003)?

    Edit your application configuration properties and enable detailed error ASP
    error messages.
    IIS Manager -> You application folder -> Propeties -> Home
    Directory ->Configuration...-> App Debugging -> Send detailed ASP error
    messages to client.

    What do you get back now?
    What is the system codepage of the server you are using?


    >
    > "Anthony Jones" <> wrote in message
    > news:uL#...
    > >
    > > <Elliot> wrote in message
    > > news:...
    > >> Can I have this function?
    > >> When a user click on a link, my ASP page generates a text file call

    > > test.txt
    > >> containing a string of "This ia s test msg.", and then a download
    > >> dialogue
    > >> appears.
    > >> Any reference for me?
    > >> Thanks in advance.
    > >>

    > >
    > > How's this:-
    > >
    > > <%
    > > Response.CodePage = 950 ' Change to prefered codepage
    > > Response.ContentType = "text/plain"
    > > Response.CharSet = "big5" 'Change to Charset matching codepage
    > > Response.AddHeader "attachment; filename=test.txt"
    > > Response.Write "This is a test msg"
    > > %>
    > >
    > >
    > >
    Anthony Jones, Apr 8, 2007
    #4
  5. Guest

    Guest Guest

    IIS5.
    How can I know the system codepage of my server?
    The followings are the technical information.

    Error Type:
    Microsoft VBScript runtime (0x800A01C2)
    Wrong number of arguments or invalid property assignment:
    'Response.AddHeader'
    /test.asp, line 5


    Browser Type:
    Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.1; .NET CLR
    2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30)

    Page:
    GET /test.asp




    "Anthony Jones" <> wrote in message
    news:#...
    >
    > <Elliot> wrote in message
    > news:...
    >> Anthony, thanks a lot for your help.
    >> I have tried it by adding your code to my empty ASP file, however, it
    >> displayed an error 500 page. Did I do something wrong?

    >
    > IIS5 (Win2000) or IIS6 (Win2003)?
    >
    > Edit your application configuration properties and enable detailed error
    > ASP
    > error messages.
    > IIS Manager -> You application folder -> Propeties -> Home
    > Directory ->Configuration...-> App Debugging -> Send detailed ASP error
    > messages to client.
    >
    > What do you get back now?
    > What is the system codepage of the server you are using?
    >
    >
    >>
    >> "Anthony Jones" <> wrote in message
    >> news:uL#...
    >> >
    >> > <Elliot> wrote in message
    >> > news:...
    >> >> Can I have this function?
    >> >> When a user click on a link, my ASP page generates a text file call
    >> > test.txt
    >> >> containing a string of "This ia s test msg.", and then a download
    >> >> dialogue
    >> >> appears.
    >> >> Any reference for me?
    >> >> Thanks in advance.
    >> >>
    >> >
    >> > How's this:-
    >> >
    >> > <%
    >> > Response.CodePage = 950 ' Change to prefered codepage
    >> > Response.ContentType = "text/plain"
    >> > Response.CharSet = "big5" 'Change to Charset matching codepage
    >> > Response.AddHeader "attachment; filename=test.txt"
    >> > Response.Write "This is a test msg"
    >> > %>
    >> >
    >> >
    >> >

    >
    >
    Guest, Apr 9, 2007
    #5
  6. <Elliot> wrote in message
    news:...
    > IIS5.
    > How can I know the system codepage of my server?
    > The followings are the technical information.
    >
    > Error Type:
    > Microsoft VBScript runtime (0x800A01C2)
    > Wrong number of arguments or invalid property assignment:
    > 'Response.AddHeader'
    > /test.asp, line 5
    >


    That's my fault not being careful with the typing that line should read:-

    Response.AddHeader "Content-Disposition", "attachment; filename=test.txt"


    >
    > Browser Type:
    > Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.1; .NET CLR
    > 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30)
    >
    > Page:
    > GET /test.asp
    >



    >
    >
    >
    > "Anthony Jones" <> wrote in message
    > news:#...
    > >
    > > <Elliot> wrote in message
    > > news:...
    > >> Anthony, thanks a lot for your help.
    > >> I have tried it by adding your code to my empty ASP file, however, it
    > >> displayed an error 500 page. Did I do something wrong?

    > >
    > > IIS5 (Win2000) or IIS6 (Win2003)?
    > >
    > > Edit your application configuration properties and enable detailed error
    > > ASP
    > > error messages.
    > > IIS Manager -> You application folder -> Propeties -> Home
    > > Directory ->Configuration...-> App Debugging -> Send detailed ASP error
    > > messages to client.
    > >
    > > What do you get back now?
    > > What is the system codepage of the server you are using?
    > >
    > >
    > >>
    > >> "Anthony Jones" <> wrote in message
    > >> news:uL#...
    > >> >
    > >> > <Elliot> wrote in message
    > >> > news:...
    > >> >> Can I have this function?
    > >> >> When a user click on a link, my ASP page generates a text file call
    > >> > test.txt
    > >> >> containing a string of "This ia s test msg.", and then a download
    > >> >> dialogue
    > >> >> appears.
    > >> >> Any reference for me?
    > >> >> Thanks in advance.
    > >> >>
    > >> >
    > >> > How's this:-
    > >> >
    > >> > <%
    > >> > Response.CodePage = 950 ' Change to prefered codepage
    > >> > Response.ContentType = "text/plain"
    > >> > Response.CharSet = "big5" 'Change to Charset matching codepage
    > >> > Response.AddHeader "attachment; filename=test.txt"
    > >> > Response.Write "This is a test msg"
    > >> > %>
    > >> >
    > >> >
    > >> >

    > >
    > >
    Anthony Jones, Apr 10, 2007
    #6
  7. Guest

    Guest Guest

    It works perfectly, Anthony. You help me a lot. Thanks again for your kindly
    intention.


    "Anthony Jones" <> wrote in message
    news:...
    >
    > <Elliot> wrote in message
    > news:...
    >> IIS5.
    >> How can I know the system codepage of my server?
    >> The followings are the technical information.
    >>
    >> Error Type:
    >> Microsoft VBScript runtime (0x800A01C2)
    >> Wrong number of arguments or invalid property assignment:
    >> 'Response.AddHeader'
    >> /test.asp, line 5
    >>

    >
    > That's my fault not being careful with the typing that line should read:-
    >
    > Response.AddHeader "Content-Disposition", "attachment; filename=test.txt"
    >
    >
    >>
    >> Browser Type:
    >> Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.1; .NET CLR
    >> 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30)
    >>
    >> Page:
    >> GET /test.asp
    >>

    >
    >
    >>
    >>
    >>
    >> "Anthony Jones" <> wrote in message
    >> news:#...
    >> >
    >> > <Elliot> wrote in message
    >> > news:...
    >> >> Anthony, thanks a lot for your help.
    >> >> I have tried it by adding your code to my empty ASP file, however, it
    >> >> displayed an error 500 page. Did I do something wrong?
    >> >
    >> > IIS5 (Win2000) or IIS6 (Win2003)?
    >> >
    >> > Edit your application configuration properties and enable detailed
    >> > error
    >> > ASP
    >> > error messages.
    >> > IIS Manager -> You application folder -> Propeties -> Home
    >> > Directory ->Configuration...-> App Debugging -> Send detailed ASP error
    >> > messages to client.
    >> >
    >> > What do you get back now?
    >> > What is the system codepage of the server you are using?
    >> >
    >> >
    >> >>
    >> >> "Anthony Jones" <> wrote in message
    >> >> news:uL#...
    >> >> >
    >> >> > <Elliot> wrote in message
    >> >> > news:...
    >> >> >> Can I have this function?
    >> >> >> When a user click on a link, my ASP page generates a text file call
    >> >> > test.txt
    >> >> >> containing a string of "This ia s test msg.", and then a download
    >> >> >> dialogue
    >> >> >> appears.
    >> >> >> Any reference for me?
    >> >> >> Thanks in advance.
    >> >> >>
    >> >> >
    >> >> > How's this:-
    >> >> >
    >> >> > <%
    >> >> > Response.CodePage = 950 ' Change to prefered codepage
    >> >> > Response.ContentType = "text/plain"
    >> >> > Response.CharSet = "big5" 'Change to Charset matching codepage
    >> >> > Response.AddHeader "attachment; filename=test.txt"
    >> >> > Response.Write "This is a test msg"
    >> >> > %>
    >> >> >
    >> >> >
    >> >> >
    >> >
    >> >

    >
    >
    Guest, Apr 10, 2007
    #7
    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. Purvi T
    Replies:
    0
    Views:
    831
    Purvi T
    Oct 19, 2004
  2. mike parr
    Replies:
    1
    Views:
    475
    Marina
    May 20, 2004
  3. Ben Fidge
    Replies:
    5
    Views:
    737
    S. Justin Gengo
    Jun 15, 2004
  4. Chu
    Replies:
    2
    Views:
    905
    Winista
    Apr 10, 2006
  5. Amy
    Replies:
    0
    Views:
    978
Loading...

Share This Page