Roundcube Community Forum

 

download all attachments in one zip file

Started by JohnDoh, February 21, 2010, 06:45:44 AM

Previous topic - Next topic

JohnDoh

the zipdownload plugin has been distributed with roundcube since about version 0.9 I think so it should be already in your plugins folder. all you need to do is configure an enable it.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

volcano

JohnDoh
Thank you! I was just not enough attentive.

volcano

I fired up this plugin, but it has an issue with cyrillic filenames. When I open downloaded archive with attachments their filenames are broken. Does anybody know how to fix it?

alec

This is zip format problem. https://bugs.php.net/bug.php?id=51929. You can try to change zipdownload_charset, but I'm afraid there's no good solution for this.

vitg

There is a problem with unique file names in zip archive.

You can fix it at zipdownload.php


            ....
            +$arrLocalNames = array();

            foreach ($message->attachments as $part) {
            ....



            ....
            $disp_name   = $this->_convert_filename($filename);

            +if (!empty($disp_name))
            +{
            +  // We have to make sure that there aren't two of the same local names.
            +  // Otherwise, one file will override the other and we will be missing the file.
            +  while($arrLocalNames[$disp_name] > 0)
            +   {
            +    $arrPathInfo = pathinfo($disp_name);
            +      $intNext = $arrLocalNames[$disp_name]++;
            +      $disp_name = $arrPathInfo['filename'] . "_" . $intNext . "." . $arrPathInfo['extension'];
            +   }
            +  // Add to the count.
            +  $arrLocalNames[$disp_name]++;                                       
            +}
           
            $tmpfn       = tempnam($temp_dir, 'zipattach');
            ....


Have a nice day! :)