FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Generating "download" pages
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Generating "download" pages [message #186405 is a reply to message #186399] Sat, 19 July 2014 16:25 Go to previous messageGo to previous message
Lew Pitcher is currently offline  Lew Pitcher
Messages: 60
Registered: April 2013
Karma:
Member
I will elaborate on the processing I'm trying to perform:

On Friday 18 July 2014 09:55, in comp.lang.php, "Lew Pitcher"
<lew(dot)pitcher(at)digitalfreehold(dot)ca> wrote:

> I'm not certain that what I want can be done, let alone done with PHP, but
> please let me describe the function I'm looking for:
>
>
> On response to a trigger on one web page, I want to be able to generate
> and display a new web page, /and/ at the same time, send an associated
> file as a download.
>
> The user selects (in this case) "Export recipes" (I'm developing a
> PHP/MySQL recipe management application), which causes
> 1) the page to change to a "Download in progress" page, and
> 2) a file (in this case, an XML file containing the recipes) to be sent to
> the client.

I already have a working PHP/MySQL/HTML page that permits the end user to
refine a list of known recipes by various criteria. This same page provides
options, once the user has adequately refined the recipe list, to View a
single recipe, or to Export all the selected recipes. It is this Export
function that I am now designing.

Conceptually, if the user selects the "Export" option on the menu page, the
browser would display an "Export Options" page that lists the various
export formats the selected recipes can be saved as. Initially, this would
include PDF (for offline viewing or printing), and as a recipe interchange
file (possibly a MealMaster file, although I would like to include to a
custom XML representation as well.

On this "Export Options" page, the user will
1) select the appropriate option, and then
2) select the "Send" button

The PHP behind this page will then
a) build the appropriate transport format file
b) send the file to the user, and
c) resend the "Export Options" page.

From the users POV, he
a) sees the initial "Export Options" page,
b) selects the requisite transport format for the selected recipes,
c) selects the "Send" button,
d) sees a redisplayed "Export Options" page, and
e) sees a file (of appropriate type) downloading (or the browsers Download
menu, if default download options have not been set)
At this point, the user can then either select a new transport format, and
go through the process again, or select a "Return to Menu" option that
redirects to the menu PHP file.


> Is this doable? How do I do this with PHP?

Research has shown conflicting advice wrt the necessary headers, the order
of the headers, the presence or absence of the web page HTML, the PHP
functions required to send the file, etc.

--
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Resolved: Generating "download" pages
Next Topic: Your opinion on which technologies to use when building web applications
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Dec 21 15:58:42 GMT 2024

Total time taken to generate the page: 0.04590 seconds