In answers to other questions it was pointed out that SourceForge's download page worked by adding a hidden <iframe>. This does no longer seem to be the case...
How is the current version of the download page implemented? I'd like to build something similar because I consider SF's solution quite elegant.
Ok, more precisely...True, the initial "question" was too vague.
If you go to http://sourceforge.net/projects/beankeeper/files/beankeeper/2.6.2/beankeeper-2.6.2.tar.gz/download there's a plain old HTML link to download the file in question but there's also an automatic download. The delay seems to be some 2s.
Someone asked for my particular use case. I'll answer that knowing that it might divert from the OP to a certain extent. Very much simplified:
- more or less traditional JEE app with two Servlets
- a dispatcher Servlet which acts as an entry point for the UI controller
- a "document Servlet" which streams PDF to the browser, it does so with content-disposition=attachment i.e. browser shows save-or-open dialog
- a print out page with a number of input fields and a submit button
- when the submit button is clicked
- the input field values should be updated in the UI model (and session where necessary) -> that's what the dispatcher Servlet does
- the creation of the PDF must be triggered -> that's what the document Servlet does
If I adopted SF's model a form submit would trigger the dispatcher Servlet and reload the current page (regular behavior). Upon reload of the page I would somehow - right, how does SF do that? - cause the browser to invoke the document Servlet.