Skip to content

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

@taalexlistex

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!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions