tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Wall" <d.w...@computer.org>
Subject Re: Response and file downloads
Date Mon, 01 Nov 2004 21:08:02 GMT
> I know there is only a single response, thats why I want to create a new
one :)

Then you need to have the client create another request.

> How do other sites generate files on the fly (take it out of a database,
or a report just run), on form submit, and send them down the line and not
run into this problem?

Which other sites?  Can you point to one that we'd all be able to see?
Often with a sample site, it's easier to tell you how they did it.

I've seen some sites that simply return a "thank you" or other updated page.
It often contains a link to the download, with a message that says a
download should trigger automatically within a few seconds.  In this
scenario, I believe they are returning a page with a link that would cause
the file to be downloaded (so the user could click it if the download didn't
start) along with an HTML HEAD refresh tag like: <meta http-equiv="Refresh"
content="1;URL=/path/to/download/file">

Such a refresh tag will cause the browser to wait a second (in this case 1
second because 1 is before the semicolon) and then issue a GET on the URL
provided.  Since the URL is for a file download, it appears that you've both
triggered a download AND returned a page, but in fact, you just returned a
page, and that page triggered the auto-GET that triggers the download.

David


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message