How To: upon button click 1. load new page and 2. download file
How To: upon button click 1. load new page and 2. download file
am 23.08.2007 22:24:48 von sven.seuken
Hello everybody,
I need the following functionality for my webpage and don't know how
to realize it:
When the user clicks the "download button" on my page, a new webpage
shall load (saying something like "thank you for the download...") and
at the same time, a file download dialogue shall open. It does not
matter in which order this happens ,i.e. whether the new webpage loads
after the user has saved the file somewhere or whether first the new
webpage loads and then the file download dialogue opens, though the
second option would be preferred.
I have tried many different ways, but none worked for me.
Any help appreciated.
Thanks,
Sven.
Re: How To: upon button click 1. load new page and 2. download file
am 23.08.2007 23:19:45 von Michael Fesser
..oO(sven.seuken@gmail.com)
>When the user clicks the "download button" on my page, a new webpage
>shall load (saying something like "thank you for the download...") and
>at the same time, a file download dialogue shall open.
Since you can't send two resources at the same time to the browser, this
is usually done with a "Thank you" page, which contains a meta-refresh
to the download file. The browser gets the page, and after some seconds
he follows the meta-refresh to get the actual file. Ugly, but common.
Personally I wouldn't do it. Why should I thank someone for downloading
anything from my site? Doesn't really make sense to me. YMMV, though.
Micha
Re: How To: upon button click 1. load new page and 2. download file
am 24.08.2007 02:18:16 von Jerry Stuckle
sven.seuken@gmail.com wrote:
> Hello everybody,
>
> I need the following functionality for my webpage and don't know how
> to realize it:
>
> When the user clicks the "download button" on my page, a new webpage
> shall load (saying something like "thank you for the download...") and
> at the same time, a file download dialogue shall open. It does not
> matter in which order this happens ,i.e. whether the new webpage loads
> after the user has saved the file somewhere or whether first the new
> webpage loads and then the file download dialogue opens, though the
> second option would be preferred.
>
> I have tried many different ways, but none worked for me.
> Any help appreciated.
>
> Thanks,
> Sven.
>
I agree with Michael you shouldn't do it. But if you insist, you can't
do it from PHP. Try a javascript newsgroup.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================