so you have some .pdf files on your server and want to zip them for
sending them packaged to the requesting client.
The steps would be (assuming you're using PHP's zipping functionalities):
1) Collect the .pdf contents into a temporary zip file. (see PHPs-docs)
2) Set Zend_Controller_Response's MIME-type to "application/zip".
3) Set the Response's content to the temporary zip-file & send it.
The client's browser should now being able to decide what to do with
the server's zip (maybe it just asks for download).
Hope it helps a bit!
Ciao Nico
On Tue, Jan 25, 2011 at 6:55 PM, Thomas List <thomaslist@hotmail.com> wrote:
>
> Hello,
>
> I am trying to create a zip file so I can download multiple .pdf files. The problem I am having is that when I create the Zip file, I do not know where it gets created, and the files are never written to it.
> I am using the pretty standard code :
>
> if ($zip->open($archive_file_name, ZIPARCHIVE::CREATE )!==TRUE) {
> exit("cannot open <$archive_file_name>\n");
> }
>
> to create the file, but I am unable to set the file path because I do not know where the zip file is located. Does anyone know where the file is created so I can write the files to it and download a zip file with something in it?
>
> Regards,
> Thomas
>
没有评论:
发表评论