2

I sell songs hosted in S3. People select them and they can download, but if they buy the entire CD, they can download it as a zip file. The problem is that i have to create the zip file on the fly, which is very slow. I am using the Zip Library, adding files from string with file get contents and after that (which may take its time), the user client stars the download, which is a lot of time. Is there another way to provide it faster, maybe with some other libraries?

acasla
  • 73
  • 1
  • 7
  • 2
    Do you not have enough storage to store a zipped version of the album along with the unzipped? – Rob Jan 03 '13 at 03:51
  • this is an incredible solution, that solves the speed problems http://www.w2lessons.com/2012/01/fast-zipping-in-amazon-s3.html – Ankan-Zerob Jul 29 '14 at 08:52

2 Answers2

5

Create the zip file once, preferably when you put together the tracks, and upload it along with the individual tracks. No need to overcomplicate things.

ceejayoz
  • 165,698
  • 38
  • 268
  • 341
0

Here are some helpful links that may provide some insight as to how to do this better:

Use php to zip large files

LAMP: How to create .Zip of large files for the user on the fly, without disk/CPU thrashing

Community
  • 1
  • 1
Josh Brody
  • 4,730
  • 1
  • 10
  • 24