Re: Redirect after pdf / file download
| From: | Jim Lucas | Date: | Thu, 12 Jun 2008 14:46:16 +0000 |
| Subject: | Re: Redirect after pdf / file download | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-275282@lists.php.net to get a copy of this message | ||
Yashesh Bhatia wrote:
1. Collect Information from client & submit data 2. Process data and generate PDF, write PDF, display error/success message 3. If successful, have a javascript or <meta ..> redirect to then download PDF generated in step 2. I would do it this way so in case their were any problems generating the PDF, you would have a way to indicate that to the client. Rather then trying to force them to download a broken PDF document. One suggestion to go along with this is that you will need to have a routine that will clean out all the generated PDF's every now and again. -- Jim Lucas "Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them." Twelfth Night, Act II, Scene V by William ShakespeareWhat about doing it the other way ... submitting the page to a script that calls on the pdf creation, yet doesnt leave this script - then proceed to redirect when that script (pdf) has been completed? Ssteven:the steps u'r suggesting are1 - submit form (1.html) to script (2.php) 2 - 2.php generates the pdf but does not give it for download 3 - after generating the pdf , 2.php then redirects to 3.html.. so where does the download happen ? in 3.html ? thx. yashesh