0

I've created a photo book and I want that the users can download all the album with the respective photo but the problem is that some album have the size of 5GB and, if I compress all the photos to a zip file, the server block the request because it need too much time.

How can resolve this problem?

Is possible download multiple files without compress all into a zip file?

If yes, How?

PS: I cant modify the php.ini

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
  • What web server is this on, apache? Do you have htaccess availability? – Egg Mar 21 '16 at 16:48
  • yes, the website is hosted on one.com –  Mar 21 '16 at 16:48
  • are these jpg photos? don't compress those. you'll waste a TON of cpu time and achieve at best only a couple % compression. just zip them as is - e.g. use zip as a container, and not a compression system. – Marc B Mar 21 '16 at 16:51
  • how is possible don't compress it? can you write an example? –  Mar 21 '16 at 16:57

1 Answers1

0

If timeout is your only problem, then within PHP you can use:

ini_set('max_execution_time', 300); //300 seconds = 5 minutes

Or, if on Apache and you have htaccess availability:

php_value max_execution_time 300

Here is a great post on other examples useful if using Wordpress etc.

Zipping an unknown number of files into a 5GB+ archive sounds nasty, but that's the solution to yoru question above :) I hope you have protection against a user sitting there hitting refresh because they got impatient?

Community
  • 1
  • 1
Egg
  • 1,782
  • 1
  • 12
  • 28
  • nothing to do, this host no support .htaccess and ini_set –  Mar 21 '16 at 16:59
  • ... then you're up a creek without a paddle. You'll have to work with the time restriction you have (the default 30 seconds I assume). Limiting the number of photos per archive seems the best approach. – Egg Mar 21 '16 at 17:07