Forum Moderators: coopster

Message Too Old, No Replies

Download more than one file at a time

         

sharyn

12:24 am on Nov 9, 2004 (gmt 0)

10+ Year Member



I'm looking to find a way to download multiple files at a time. I've got my user to a page where they can check multiple boxes and then click the "download these files(s)" button. Now what I'd to happen is that the files all download into some predetermined area (the user will have no choice as to where things get to download to)

I can't seem to google any kind of script to do this. Does anyone here know of a way to do this? Thanks in advance to all that answer :D

- sharyn

crashomon

12:49 am on Nov 9, 2004 (gmt 0)

10+ Year Member



perhaps there is a way to write a script that will "wrap up into a package" by combining selected elements into a dynamically-generated zip file.

this sounds like something that could be done with PHP or Perl.

then, the user would simply receive a single download with multiple files in the zipped file.

Hope this helps, let us know what you wind up doing.

mincklerstraat

9:15 am on Nov 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What it won't let you do is force your user to save to a specified area on their hard drive.

To have multiple things downloaded, check out the PEAR package http_download; If you're happy with just having your files compressed into an archive (tar or zip) file, check out the PEAR packages in the class 'Archiving' (I don't think they have one for zip files yet - you can find one at [phpconcept.net...] . This will let you allow php to pick which files are zipped up in the package.

If you really want things installed in a specific place (and that makes a lot of sense for php), you could use an installer - I asked a similar question in a thread on the asp forum and got a good, informative answer from Hanu: [webmasterworld.com...] .

coopster

12:03 pm on Nov 9, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You could use the PHP Zlib Compression Functions [php.net] to read the files selected and write them to a compressed archive and then send your own headers to force a download process.

sharyn

12:15 am on Nov 16, 2004 (gmt 0)

10+ Year Member



ok all, I ended up using Zend's zip class [zend.com] and it works great. Thanks for all your help. :D

- sharyn