Jump to content

multilple attachments with one request


allasso

Recommended Posts

Hello,

 

I posted this on dev net but thought I would post here as well.

 

I would like for to be able to allow a client have the option to download multiple files as attachments with one request, eg, the client clicks a link on a page, or submit button, and several file download dialog boxes appear.

 

I have tried,

 

<?php

 

$type_ = EZ_ ;

 

header('Content-type: text/html');

header("Content-Disposition: attachment; filename=file_$type_.html");

readfile("file_$type_.html");

 

$type_ = prod_ ;

 

header('Content-type: text/html');

header("Content-Disposition: attachment; filename=file_$type_.html");

readfile("file_$type_.html");

 

?>

 

but it only does the first request.

 

I have tried many other things as well. Any ideas?  Or anything outside of PHP that will work?

 

I have done much searching and experimenting for the answer to this, but to no avail. I thought I would turn to the forums.

 

Thank you, Allasso

 

Link to comment
Share on other sites

Hello,

 

Just thought i'd add my thoughts on this.

 

If the page is created on the fly and the files are not always the same then have the page create the zip of the chosen files.  and then this zip could be stored in a temporary folder within your web folder i.e  public_html.  then the link to this file shown on the page.

 

ok now for the part that removes this temporary zip file.  have a cron job that runs another file that would check the date the file was created and delete all the files within this temporary folder that stores the zuip files apart from the files that have been created within the last hour and have this cron job run say every so many hours or how ever long you want to prevent your webspace from being eatten up by these temporary zip files.

 

if you need any help with setting this up get back to me via a PM

 

Jason

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.