Re: [PHP] Multiple File Downloads



phpEasyDownload
the scripts are already written at sourceforge

--
If at first you dont succeed
try try try again
If at first you do succeed
try not to look surprised

_
""Andrew Ballard"" <aballard@xxxxxxxxx> wrote in message
news:b6023aa40712141317p1da0e67xbef33745fcabc954@xxxxxxxxxxxxxxxxx
On Dec 14, 2007 3:49 PM, David Giragosian <dgiragosian@xxxxxxxxx> wrote:

On 12/14/07, Jason Pruim <japruim@xxxxxxxxxx> wrote:


On Dec 14, 2007, at 3:37 PM, Daniel Brown wrote:

On Dec 14, 2007 3:32 PM, David Giragosian <dgiragosian@xxxxxxxxx>
wrote:
I've used Richard Lynch's Blog example for forcing the download of
an
individual file.

Is there a way to download multiple files in one go, short of
zipping them
first into a single file?

Concepts / directional shoves appreciated.

I wouldn't think so, Dave, because headers for each file need to
be sent at the request for download, and headers cannot be sent
after
the header buffer has ended (when the data buffer is being sent).


I may be showing my ignorance of what can be done... But couldn't you
write a script in PHP (Or some other language) that would link to a
bunch of files and send each one individually to the browser as a
separate file? something like:

<PHP

$filesArray(file1, file2, file3);
foreach($filesArray)
$header ="Blah blah balh"
$header .="More blah blah blah"

Or am I way off base as usual? :)


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
japruim@xxxxxxxxxx


My original thought was as Daniel suggested, but I had a similar
cognitive
storm, Jason, and I gave it a try.

I didn't get any headers already sent error messages, but only the last
file
in the array was downloaded.

David


I didn't think such a thing could be possible because the *browser* is
not expecting it. (I was not aware of anything in http that defined a
method for multiple files in the response the same way you can send
multiple parts in a request or in a multipart mail message. I figured
in any case you would get at most one file (if not an error), and that
that file would contain either A) only the contents of the first or
last file pushed to the client or B) the contents of all the files,
munged together in one chunk.

However, your message prompted me to find this on Google. (It's ASP,
but should be easily converted).

http://www.motobit.com/tips/detpg_multiple-files-one-request/

I haven't tried it, so I can't really say if it works, but it's the
only way I could expect it to work.

Andrew


.



Relevant Pages

  • Re: [PHP] Multiple File Downloads
    ... I wouldn't think so, Dave, because headers for each file need to ... be sent at the request for download, and headers cannot be sent after ... $header .="More blah blah blah" ... method for multiple files in the response the same way you can send ...
    (php.general)
  • stack corruption when I call IWMDMDevice3::DeviceIoControl().
    ... across a function call, blah blah blah... ... // windows headers. ... CComPtr& spComponentAuthenticate) ... HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) ...
    (microsoft.public.windowsmedia.sdk)
  • Re: [PHP] Multiple File Downloads
    ... individual file. ... I wouldn't think so, Dave, because headers for each file need to ... be sent at the request for download, and headers cannot be sent after ... $header .="More blah blah blah" ...
    (php.general)
  • Re: For Donna
    ... Bob Cunningham writes: ... that have arrived recently, I find, in the headers: ... Each of those could have had your address in a BCC list and the ... The "blah blah blah" includes the headers, ...
    (alt.usage.english)
  • Re: #include recommendation
    ... In the next release of the C standard, Id like to see an extension of the ... #include directive to allow multiple files to be included on a single line. ... With the old methods the eyes tend to parse quicker the headers; ... but for the coding style for standard module ...
    (comp.std.c)