Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Initiating file download after form submit

Reply
Thread Tools

Initiating file download after form submit

 
 
Tim Fooy
Guest
Posts: n/a
 
      08-13-2004
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


 
Reply With Quote
 
 
 
 
Toby Inkster
Guest
Posts: n/a
 
      08-13-2004
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

 
Reply With Quote
 
 
 
 
Hywel
Guest
Posts: n/a
 
      08-13-2004
In article <411c64a4$0$299$(E-Mail Removed)>, 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/
 
Reply With Quote
 
Tim Fooy
Guest
Posts: n/a
 
      08-13-2004
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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
submit 1 form to 2 servers or 2 forms to 2 server (1 form each) on 1 submit abansal.itp@gmail.com Javascript 3 06-23-2007 07:29 AM
initiating a file download via a Button matt@mailinator.com ASP .Net 2 11-22-2005 02:26 AM
submit form, validate form, set cookie, send email, download file mhawkins19@adelphia.net Javascript 1 03-17-2005 08:19 AM
Problem displaying page before initiating file download Richard L Rosenheim ASP General 0 01-30-2005 12:02 AM
submit opener form after submitting pop-up form Marco Alting Javascript 7 10-30-2003 01:46 PM



Advertisments