Skip to content

[BUG] Mime decoder for attachment filename (Content-Disposition) #853

Open

Description

@taalexlistex

I have MIME encoded filename in Content-Disposition header like "=?UTF-8?Q?Invoice_4.png?="
ApiClient does not decode it before sanitizing and fails on temporary file creation.

if (matcher.find()) { filename = sanitizeFilename(matcher.group(1)); }

ApiClient.prepareDownloadFile must decode filename!

<dependency>
  <groupId>com.sun.mail</groupId>
  <artifactId>javax.mail</artifactId>
  <version>1.6.2</version>
</dependency>

filename = sanitizeFilename(MimeUtility.decodeText(matcher.group(1)));

This solution works fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions