Re: Generating "download" pages [message #186416 is a reply to message #186415] |
Sat, 19 July 2014 20:54 |
Lew Pitcher
Messages: 60 Registered: April 2013
Karma:
|
Member |
|
|
On Saturday 19 July 2014 16:38, in comp.lang.php, "Christoph M. Becker"
<cmbecker69(at)arcor(dot)de> wrote:
> Christoph M. Becker wrote:
>
>> 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>
>
> Of course the download resource has to be served with a Content-Type
> header field that forces the client to treat it as download.
>
Well, I'm not yet familiar enough with ECMAScript/JavaScript to write this
sort of facility into my web pages.
However, I have found a workaround that will suffice until I determine the
proper way to get both updated page /and/ download:
The request page (that which I want to update and redisplay) will contain
within it an (almost) invisible <iframe> linking to a /second/ page. That
second page will /only/ generate the file transfer headers and file.
Together, the two pages will do what I had hoped to do in one page.
Thanks to all for all the advice.
--
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request
|
|
|