Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin zipdownload pack directory into file. #4433

Closed
rcubetrac opened this issue Jan 8, 2014 · 6 comments
Closed

Plugin zipdownload pack directory into file. #4433

rcubetrac opened this issue Jan 8, 2014 · 6 comments

Comments

@rcubetrac
Copy link

Reported by dkr on 8 Jan 2014 08:10 UTC as Trac ticket #1489507

If the message contains any part of HTML and attachment,
a downloadable archive have directory ($rcmail->config->get('temp_dir'); )
with full *NIX path, which file without an extension (HTML-part of message).
If the message does not contain any HTML part, all attachments are
saved correctly.

For reproduction:

  1. Set the HTML format in the settings.
  2. Create a message with attachments and send it to yourself.
  3. In the resulting message, the list of attachments, see the part of the message in HTML format, and real investments.
  4. If you click "Download all attachments" in the resulting file will contain a directory with a file without an extension, which is part of the html message.
  5. Download all attachments as one file.

Keywords: zipdownload
Migrated-From: http://trac.roundcube.net/ticket/1489507

@rcubetrac
Copy link
Author

Comment by @alecpl on 8 Jan 2014 08:53 UTC

The problem is (most likely) that there's no fallback if part's filename is not set, which is true for HTML parts, but may also happen for other attachments. In 1.0 we skip HTML parts, but we still need a fallback.

@rcubetrac
Copy link
Author

Milestone changed by @alecpl on 8 Jan 2014 08:53 UTC

later => 1.0-stable

@rcubetrac
Copy link
Author

Comment by dkr on 8 Jan 2014 10:11 UTC

Replying to alec:

The problem is (most likely) that there's no fallback if part's filename is not set, which is true for HTML parts, but may also happen for other attachments. In 1.0 we skip HTML parts, but we still need a fallback.

Propose to use as a fallback file name distinguished name: $Subject_partN.html
But we need to replace spaces in $Subject with underscores.
Similarly, in the name of downloadable archive.
Spaces in the file name - a bad way (IMHO)

@rcubetrac
Copy link
Author

Comment by @alecpl on 9 Jan 2014 11:09 UTC

Fixed in 2eef77c.

@rcubetrac
Copy link
Author

Status changed by @alecpl on 9 Jan 2014 11:09 UTC

new => closed

@rcubetrac
Copy link
Author

Comment by dkr on 9 Jan 2014 11:48 UTC

Replying to alec:

Fixed in 2eef77c.
Yes. Fixed...
But filename of "Part 1.2" in downloaded archive not readable in case non_english interface language.

Fast, but not a beautiful solution:
In zipdownload.php, after line 113:

            if ($filename === null || $filename === '') {
                $ext = (array) rcube_mime::get_mime_extensions($part->mimetype);
                $ext = (array_shift($ext) ? array_shift($ext) : 'html');
                $filename = iconv("UTF-8","CP866",$rcmail->gettext('messagepart')) . '_' . $pid. '.' . $ext;
            }

Sorry, I'm not a programmer...
Work for me.

@rcubetrac rcubetrac added this to the 1.0.0 milestone Mar 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant