[Tutor] Sightly off topic - download file name

Discussion in 'Python' started by pxlpluker, Mar 4, 2004.

  1. pxlpluker

    pxlpluker Guest

    I what to dynamically create a page that has download links to file
    stored on disk.
    the part i don't know how to do (or if its possible) is to a different
    name appear in the browser DL window.
    i.e. I want the files stored with a random string but when being DL to
    have real name show in File Save dialog.


    Fred
     
    pxlpluker, Mar 4, 2004
    #1
    1. Advertising

  2. pxlpluker wrote:
    > I what to dynamically create a page that has download links to file
    > stored on disk.
    > the part i don't know how to do (or if its possible) is to a different
    > name appear in the browser DL window.
    > i.e. I want the files stored with a random string but when being DL to
    > have real name show in File Save dialog.
    >
    >
    > Fred


    This is not something Python-specific.
    Have a look at the "Content-Disposition" HTTP header
    (RFC 2183, http://www.faqs.org/rfcs/rfc2183.html)

    For example when you add the following HTTP header to your
    result message:

    Content-Disposition: attachment; filename="foobar.txt"

    most browsers will offer a download window for a file named
    'foobar.txt'.


    --Irmen
     
    Irmen de Jong, Mar 4, 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. Ryan Taylor
    Replies:
    2
    Views:
    983
    Ryan Taylor
    Nov 10, 2004
  2. Sam --
    Replies:
    2
    Views:
    638
    Sam --
    Mar 17, 2005
  3. Wayne...
    Replies:
    15
    Views:
    781
    Toby Inkster
    Jul 23, 2004
  4. W. eWatson

    [Tutor] "Sounding" Off, IDLE (Win7)

    W. eWatson, Feb 19, 2010, in forum: Python
    Replies:
    2
    Views:
    294
  5. jacob navia
    Replies:
    5
    Views:
    554
    spinoza1111
    May 30, 2010
Loading...

Share This Page