This is another question based on an answer that was given to me.
What I need is the ability to do a system command line zip of large files based on what the web user selects and then prompt them or force a download. Can this be done?
This is another question based on an answer that was given to me.
What I need is the ability to do a system command line zip of large files based on what the web user selects and then prompt them or force a download. Can this be done?
This can definitely be done - in fact there are many different ways to do it. One way would be to use the PHP Zip extension (http://www.php.net/manual/en/book.zip.php) to make the file archive. Then, to let the user download the file, you'll need to set the headers of your download page, like so:
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=$file");
header("Content-Type: application/zip");
header("Content-Transfer-Encoding: binary");
You may want to refer to phpMyAdmin's implementation as an example of a PHP-only implementation. Download it at phpmyadmin.net and see libraries/zip.lib.php
.
why not use the zip/unzip linux utilities? run 'zip --help' in a linux commandline for details
I would recommend using wonderful (and simple) PCLZip library: http://www.phpconcept.net/pclzip/index.en.php
You can then send the file with the headers as proposed above.