Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

Zip on the fly
https://www.tinywebgallery.com/forum/viewtopic.php?f=3&t=2280
Page 1 of 1

Author:  abbe [ 29. Nov 2009, 07:50 ]
Post subject:  Zip on the fly

Hi,

Sometimes one of my users want to download an entire folder with pictures as a zip file.

Right now I need to make a zip-filde for every folder in advance to be preparede for the rare occasion when someone want to get the entire folder.

With +14000 pictures it would take up a lot of space.

Is it possible to have TWG generate a zip archive on the fly for the user, when he wants to download the folder he is in?

Cheers,

Abbe

Author:  TinyWebGallery [ 30. Nov 2009, 10:22 ]
Post subject: 

Hi,

I actually had this before. But the big problem is that the zip file is created in memory. Because you never know how big the zip files will be it's not reliable to count on this solution because sometimes the zip will work and sometimes this will not be the case.
I still have this implementation for TFU - if you select there a couple of files a zip is build on the fly. But I don't know if you want to give your users access to the upload flash.

- Michael

Author:  abbe [ 30. Nov 2009, 11:11 ]
Post subject:  Zip files

Hi,

Thanks for the quick reply!

I see your point about memory. Is it possible to avoid this by making TWG divide the zip archive into smaller pieces, e.g. if the compressed size of a folder is 200 mb then TWG would generate fx 10 zip files at 20 mb each?

And then present the user for a list of zip files he or she can then download?

One could even have a timeout specified in the config so old TWG-generated zipfiles are deleted automatically after x days. As well as maximum zip-file size and so on.

/Abbe

Author:  abbe [ 30. Nov 2009, 11:13 ]
Post subject:  Zip on the fly

Oh, I forgot, I dont want to use the TFU for this if I can avoid it.

/Abbe

Author:  TinyWebGallery [ 30. Nov 2009, 11:26 ]
Post subject: 

I actually just found a class where less memory is used - but this takes a long time to zip and I don't know if users will wait that long. Maybe it would be better to add the functionality to create the zip files in the backend.

- Michael

Author:  abbe [ 30. Nov 2009, 11:40 ]
Post subject:  Zip on the fly

Hi again,

How much longer would it take? A few minutes would be ok I guess.

That backend functionality sounds very nice indeed, but it would REALLY rock if TWG could make those archives on the fly.

I would like to avoid giving backend acces to those users who would need to get the zip-files.

/Abbe

Author:  TinyWebGallery [ 30. Nov 2009, 11:46 ]
Post subject: 

depends on the folder - if you have 50 MB to zip ... 250 MB to zip ...

The task in the backend would not make zips on the fly. You would have to start this task.

- Michael

Author:  abbe [ 1. Dec 2009, 12:52 ]
Post subject:  Zip on the fly

Hi,

I understand that the backend function would have to be started manually and it would be a cool function for those who don't have direct access to their server: If you need to compress a folder, just make it on the server, no need to ftp a zip file to the server.

What I had in mind though was a line in the top section, perhaps next to "comments" or "info" that said "download as zip" for instance.

Click it and the server compresses the folder you are in to zip, perhaps split into parts, and the user can download the entire folder.

I checked my pictures and most folders are between 100 and 250 mb in size.

My server runs on an Intel e6600 duo core with 2 GB of ram, and 256 recognized by PHP and TWG.

Would it really take that long to make a zip file for fx a 250 mb folder - even with the slow class you mention?

/Abbe

Author:  TinyWebGallery [ 1. Dec 2009, 13:03 ]
Post subject: 

point is - I don't know - but there is quite some changes needed to do this. My todo list is like 2 pages long right now - so you would have to do the changes by yourself or I can make you a personal offer for doing this change.

- Michael

Author:  abbe [ 3. Dec 2009, 11:57 ]
Post subject:  Zip on the fly

Hi,

I would be interested in a offer. Would these changes still be there, next time I upgrade TWG or be overwritten?

Cheers,

Abbe

Author:  TinyWebGallery [ 3. Dec 2009, 12:09 ]
Post subject: 

Please contact me by e-mail.

- Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/