How to add a file inside the zip favourite download? How to add a file inside the zip favourite download?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

How to add a file inside the zip favourite download?

Started by Fabricio Ferrero, September 27, 2008, 03:50:03 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Fabricio Ferrero

Hi,

I set "allow favourites zip downloading" and work perfect.
I was wondering if there is any way to add a file (as a txt) to the zip so when the users download his favourites pictures, he also get a txt inside that zip file. Has anybody did this before and would like to share?

P.S: I don't know if this is already requested but would be an excelent feature for 1.5 imo.
Read Docs and Search the Forum before posting. - Soporte en español
--*--
Fabricio Ferrero's Website

Catching up! :)

Joachim Müller

As far as I know this has not been coded yet. I'm not sure if it should go into a release, as zip download is a feature that is bound to break for larger downloads anyway, since zip-creation on the server is a resources intensive process that fails easily.
To come up with this, you need to review zipdownload.php (in the coppermine root): before the start of the loop, you need to add the text file to the list. To keep things easy and avoid dynamic creation of the text files, create the text file in advance. Let's assume that you have already created the textfile named "readme.txt" within your albums folder. Findif (count($FAVPICS)>0){and add after it (in a line of it's own)        $filelist[] = $CONFIG['fullpath'].'readme.txt';Please keep in mind that I have coded this out of the back of my head without testing it, so please report back.

Nibbler


Joachim Müller

I stand corrected. I have added this feature to cpg1.5.x, as it was easily accomplished.

Fabricio Ferrero

Reporting back...

Both solutions works as expected. I choose Nibbler's one because it's shorter and works as well too.

Adding this to 1.5 it's great. I think almost all users that allow zip downloading would love this feature, don't you think? So thanks to considering this. I will not create a topic in feature request, it's sensless. But, maybe you should consider moving this to mod sub-forum.

Ok, once again, thank both of you very much to come up with a solution in no time. I would love have coding skills but I don't.  :'(

Thanks,
Read Docs and Search the Forum before posting. - Soporte en español
--*--
Fabricio Ferrero's Website

Catching up! :)