Filenames with spaces are truncated by Camunda due to lack of filename encoding on Content-Disposition header

When uploaded files contain spaces, like “My file.pdf” they are uploaded correctly but then when they are downloaded via cam-file-download directive or a direct call to the res aPI the file is just saved as “My”.

Analyzing the issue I noticed the content-disposition header is malformed, it is set as
“Content-Disposition: attachment; filename=My file.pdf”.

But spaces in filename should be URL encoded, so it shuold be:
“Content-Disposition: attachment; filename=My%20file.pdf”.

Can I have this fixed please?

Regards,

Hi @johnccr,

please create a ticket in our issue tracker. If you like to contribute the fix yourself we are happy to accept pull requests on GitHub.

Best,
Miklas

Thanks for the advise Miklas I have created issue CAM-11925. I would be happy to contribute with a fix so I have also forked the project already, I will create a pull request when done.

Regards,
Juan C Calderon

Changes done, pull request in place Pull 834 please review and merge changes :slight_smile:

1 Like

BTW the solution was not URL encode but to enclose in quotes as per RFC 2231