FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Page redirect and download

 


kv
On click of a link, I want to do this.

1. First show a page to user that his download is being prepared
2. Once server has prepared the content, push file to browser so that it displays the open/save dialog box (attachment disposition is ok)
3. Refresh the page with new page saying the process finished, irrespective whether user saves/cancels the download.

All this should happen at one click

How to achieve this?
Stubru Freak
If the preparation of the download doesn't take too long, you can open a page with a hidden iframe, download the file in that iframe, then when the iframe is loaded refresh the page.
darkness
Na....
Dont do this with a hidden iframe, why?
You can better ask this question in the PhP forum. Javascript can't read if a file is ready to download from a server....
As long as i know....
But you can try it, but you need a long page of code...
Stubru Freak
darkness wrote:
Na....
Dont do this with a hidden iframe, why?
You can better ask this question in the PhP forum. Javascript can't read if a file is ready to download from a server....
As long as i know....
But you can try it, but you need a long page of code...


PHP can't just send data to a computer.
And an alternative to the hidden iframe would be AJAX. But that's slightly harder. The normal way is the hidden iframe.
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.