Initiating file download after form submit

Discussion in 'HTML' started by Tim Fooy, Aug 13, 2004.

  1. Tim Fooy

    Tim Fooy Guest

    Hi all,

    I'm having this (i think) simple problem. On my page the user can submit a
    form, which calls back to the same page (it's actually PHP, but that doesn't
    matter i think). The PHP records the submitted data into a archive-file.
    And after that, the user should get a download dialog, asking where he would
    like to save a file (not the archive-file). How can i initiate such a
    download dialog without the user having to manually click on a direct link
    to the file?

    TIA,

    regs,

    Tim
     
    Tim Fooy, Aug 13, 2004
    #1
    1. Advertising

  2. Tim Fooy

    Toby Inkster Guest

    Tim Fooy wrote:

    > I'm having this (i think) simple problem. On my page the user can submit a
    > form, which calls back to the same page (it's actually PHP, but that doesn't
    > matter i think). The PHP records the submitted data into a archive-file.
    > And after that, the user should get a download dialog, asking where he would
    > like to save a file (not the archive-file).


    Your form handler should, instead of returning a "Thank You" page, send an
    application/zip Content-Type header and then the zipped data.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Aug 13, 2004
    #2
    1. Advertising

  3. Tim Fooy

    Hywel Guest

    In article <411c64a4$0$299$>, Tim Fooy says...
    > Hi all,
    >
    > I'm having this (i think) simple problem. On my page the user can submit a
    > form, which calls back to the same page (it's actually PHP, but that doesn't
    > matter i think). The PHP records the submitted data into a archive-file.
    > And after that, the user should get a download dialog, asking where he would
    > like to save a file (not the archive-file). How can i initiate such a
    > download dialog without the user having to manually click on a direct link
    > to the file?


    Read up on PHP's "header()" function.

    --
    Hywel

    http://sponsorhywel.org.uk/
     
    Hywel, Aug 13, 2004
    #3
  4. Tim Fooy

    Tim Fooy Guest

    Thanks both!

    "Tim Fooy" wrote...
    > Hi all,
    >
    > I'm having this (i think) simple problem. On my page the user can submit

    a
    > form, which calls back to the same page (it's actually PHP, but that

    doesn't
    > matter i think). The PHP records the submitted data into a archive-file.
    > And after that, the user should get a download dialog, asking where he

    would
    > like to save a file (not the archive-file). How can i initiate such a
    > download dialog without the user having to manually click on a direct link
    > to the file?
    >
    > TIA,
    >
    > regs,
    >
    > Tim
    >
    >
     
    Tim Fooy, Aug 13, 2004
    #4
    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. Jay
    Replies:
    8
    Views:
    6,697
    livshitz
    Jun 12, 2011
  2. Replies:
    2
    Views:
    373
  3. Richard L Rosenheim

    Problem displaying page before initiating file download

    Richard L Rosenheim, Jan 30, 2005, in forum: ASP General
    Replies:
    0
    Views:
    136
    Richard L Rosenheim
    Jan 30, 2005
  4. Replies:
    1
    Views:
    754
    Randell D.
    Mar 17, 2005
  5. Replies:
    3
    Views:
    796
Loading...

Share This Page