• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple file downloads using force_download()

#1
[eluser]tomgkelly[/eluser]
I'm developing an application that allows users to download files. The user selects files from a pseudo catalog and they're place in a cue. When the users decide they've selected what they need they hit the download button to download all the selected files.

Everything up to the download operation works fine, but when the download function executes, only the first file in the cue is downloaded.

I'm using the force_download() function (from the download helper) in a loop in conjunction with an array that supplies filenames etc. The loop executes through the first iteration and then exits after the force_download() call.

Anyone have any ideas?

Thanks in advance

#2
[eluser]Pascal Kriete[/eluser]
You can't send more than one file. The download helper calls exit() once it sends the file.
Imagine the mess a download with a lot of files would cause.

Is zipping them an option?

#3
[eluser]tomgkelly[/eluser]
They could conceivably wind up being fairly large files .... most likely mpg2 and mpg3, but yes I could zip them, but I don't think I'd gain any compression to speak of.

I notice the exit in the helper source and thought it might part of the problem, but commenting it out doesn't seem to effect things one way or another.

I may have to rethink downloads a bit and discuss things with my client.

Thanks for the input,

Tom


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.