Re: Generating "download" pages [message #186414 is a reply to message #186411] |
Sat, 19 July 2014 20:18 |
Christoph Michael Bec
Messages: 207 Registered: June 2013
Karma:
|
Senior Member |
|
|
Lew Pitcher wrote:
So, given that I'd like two things to happen (the web page to refresh /and/
> a file to download) on one HTTP request (ideally, a POST), what sort of
> processing do I need to do in PHP?
As Thomas had already pointed out (no pun intended), this has nothing to
do with PHP in a strict sense, but is an HTTP issue.
> Or, /can/ I do this at all?
I still don't think that it is possible via HTTP only.
> Obviously,
> some web pages /do/ this sort of thing, so it must be possible, but /how/
> they do it is the question I can't answer.
Please post an URL to such a ressource. Maybe others can answer how
they are doing it.
One solution relying on client side ECMAScript support would be to add
the following script element to the document (e.g. at the bottom of the
body element):
<script>window.location = "file-to-download.ext"</script>
--
Christoph M. Becker
|
|
|