Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: JohnDoh on February 21, 2010, 06:45:44 AM

Title: download all attachments in one zip file
Post by: JohnDoh on February 21, 2010, 06:45:44 AM
Hi,

Could any one help be test a new plugin please? The zipdownload plugin adds a little icon to the beginning of the attachment list when a message has multiple attachments to allow them all to be downloaded in a single zip file.

Please download it from here RoundCube Plugins & Patches (http://tehinterweb.co.uk/roundcube/#pizipdownload)

I was thinking the plugin could also be extended to allow the download of multiple messages or email folders but attachment download is first.

Please post feedback in this thread. Thanks.
Title: download all attachments in one zip file
Post by: oldschool on February 21, 2010, 09:15:35 AM
Hi!

I never have a need for that, but after reading your post the idea is cool.
Thanks.


Rgds.
Title: download all attachments in one zip file
Post by: rosali on February 21, 2010, 09:40:10 AM
Works for me like a charm. Great idea and great work as everytime!
Title: download all attachments in one zip file
Post by: mishoddt on February 25, 2010, 06:52:11 PM
Works for me too (Windows Server 2003/PHP 5.2.11). Please, add to the Readme file that the php class 'ZipArchive' must be installed and the php_zip extension enabled.
Title: download all attachments in one zip file
Post by: JohnDoh on February 26, 2010, 03:03:34 AM
good idea, will do.
Title: download all attachments in one zip file
Post by: PeterHaartsen on February 27, 2010, 10:08:33 AM
I use Roundcube 0.3.1 on a PHP 5.1.6 system (Linux Fedora Core 6). I had to install  php-pecl-zip to get the php class 'ZipArchive' working. Now it works perfectly!
Title: download all attachments in one zip file
Post by: dakkar on March 02, 2010, 12:04:16 PM
works like a charm ;)

thank u very much for this Plugin ;)

Dakky
Title: thanks
Post by: sh0x on March 13, 2010, 04:00:46 PM
awesome! makes it easy to download pics from email.
Title: download all attachments in one zip file
Post by: Seanster on March 17, 2010, 01:33:36 AM
rcube SVN 20100121 & php 5.2.11

no problems. thanks for the effort.
Title: Not Working
Post by: jmoore on March 24, 2010, 09:41:18 AM
Not working...can't load message with multiple attachments.  Using WAMP server 2.0 (php version 5.2.9-2) with latest stable roundcube.  Only messages with one attachment or no attachments will load.
Title: download all attachments in one zip file
Post by: JohnDoh on March 24, 2010, 03:41:43 PM
hi, thanks for the bug report but what exactly does "Not working" mean? also is there anything in the rc error log?
Title: Not Working
Post by: jmoore on March 25, 2010, 08:33:23 AM
When I enable the zipdownload plugin I can view any email except for a message with multiple attachments.  Here is the error that I get.

[25-Mar-2010 08:25:23] PHP Fatal error:  Call to undefined method
zipdownload::local_skin_path() in .........\zipdownload\zipdownload.php on line 37
Title: download all attachments in one zip file
Post by: JohnDoh on March 25, 2010, 12:07:37 PM
ah, you need RC 0.3.1 or SVN to use this plugin.
Title: Thanks
Post by: jmoore on March 25, 2010, 01:30:48 PM
Thanks ....I will update soon so that I may use this feature....can't wait to report back.
Title: Works!
Post by: jmoore on April 01, 2010, 05:21:47 PM
Thanks JohnDoh!!!  Works perfect.....awesome plugin!!
Title: Danish translation
Post by: osos on April 24, 2010, 07:27:53 AM
Great plugin.

Here is the Danish translation
Title: download all attachments in one zip file
Post by: JohnDoh on April 25, 2010, 03:58:57 AM
thanks osos
Title: download all attachments in one zip file
Post by: Schmatze on May 12, 2010, 07:55:57 AM
Hi, I changed line
Code: [Select]
if (substr_count($p['content'], '<li>') > 1) {
to
Code: [Select]
if (substr_count($p['content'], '
  • ') > 0) {
    because I can't download *.html files correctly with roundcube. For more infos: http://www.roundcubeforum.net/5-release-support/17-pending-issues/6696-html-attachment-not-viewable.html#post27390
  • Title: download all attachments in one zip file
    Post by: voltron81 on May 18, 2010, 06:18:19 AM
    Cool plugin... :D

    So if I've correctly understand it, if I'm over a very slow connection, I will have a zip compression for my attachments...so I will use less bandwith...right?


    thanks
    Michele
    Title: download all attachments in one zip file
    Post by: JohnDoh on May 18, 2010, 12:50:32 PM
    thats right
    Title: download all attachments in one zip file
    Post by: ABerglund on May 18, 2010, 02:41:12 PM
    Hmm. My zip archives all come down as damaged and un-openable. Running it on Fedora Core 10, PHP 5.2.9, Zip appears to be enabled per phpinfo(), but regardless of browser or OS, the file is bad. What am I missing here?
    Title: download all attachments in one zip file
    Post by: JohnDoh on May 19, 2010, 03:41:20 AM
    thats odd. is there anything in the error log? have you looked if there is actually any data at all in the zip file?
    Title: download all attachments in one zip file
    Post by: ABerglund on May 19, 2010, 11:40:49 AM
    No, nothing in the error log at all. The plugin thinks it is working fine. There is no useable data inside the archive that I can get to. Attempting to open one in Windows delivers a generic "archive damaged" message. A Mac can open it, but it contains a different type of archive, which will expand into another zip, then another... in an endless loop.

    I suspect that this is not really a problem with the plugin, but more likely a problem with my PHP packages and or config. Any assistance there is welcome.
    Title: download all attachments in one zip file
    Post by: rosali on June 07, 2010, 11:06:35 AM
    I have the same problem here. I will check if RarArchive does the job.
    Title: download all attachments in one zip file
    Post by: rosali on July 06, 2010, 07:37:43 AM
    It looks like zip in PHP 5.2.7 to 5.2.10 is buggy.

    addFromString produces corrupt archive if string is longer than 255 chars.

    PHP :: Bug #48763 :: ZipArchive produces corrupt OpenOffice.org files (http://bugs.php.net/48763)
    Title: download all attachments in one zip file
    Post by: rosali on July 06, 2010, 01:44:44 PM
    Everything is fine after upgrading to PHP 5.3.1
    Title: download all attachments in one zip file
    Post by: JohnDoh on July 06, 2010, 02:00:19 PM
    thanks for getting to the bottom of this rosali
    Title: download all attachments in one zip file
    Post by: rosali on July 06, 2010, 02:15:59 PM
    To clarify: I debugged PHP 5.2.7 - 5.2.10 on Windows OS. Don't know if *nix OS is affected too. 5.2.6 is fine on Windows. Bug starts on PHP 5.2.7. Don't know if the bug was fixed on 5.3.0. But as said 5.3.1 is ok.

    JohnDoh, I've a credit next time when I'm again too dumb to adjust simple css files ;-)
    Title: download all attachments in one zip file
    Post by: JohnDoh on August 07, 2010, 07:39:43 AM
    The repo version of this plugin has been updated to allow the downloading of entire folders and also of groups of messages as zip files. The various download options are also now configurable.

    These new options are only available in the repo version of the plugin at the moment, they are not part of today's 0.4-stable release.
    Title: Re: download all attachments in one zip file
    Post by: volcano on July 25, 2016, 07:29:44 AM
    Hello. Plugin page in first post seems to be outdated. If I try to search it manually there is no page at all. Where can I find it? In the latest roundcube release I can't find this feature too.
    Title: Re: download all attachments in one zip file
    Post by: JohnDoh on July 25, 2016, 07:32:21 AM
    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.
    Title: Re: download all attachments in one zip file
    Post by: volcano on July 26, 2016, 01:12:55 AM
    JohnDoh
    Thank you! I was just not enough attentive.
    Title: Re: download all attachments in one zip file
    Post by: volcano on July 29, 2016, 02:25:29 AM
    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?
    Title: Re: download all attachments in one zip file
    Post by: alec on July 29, 2016, 03:13:28 AM
    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.
    Title: Re: download all attachments in one zip file
    Post by: vitg on September 20, 2016, 04:15:17 PM
    There is a problem with unique file names in zip archive.

    You can fix it at zipdownload.php

    Code: [Select]
                ....
                +$arrLocalNames = array();

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

    Code: [Select]
                ....
                $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! :)