Decode base64 to PDF - Missing file extension - Mendix Forum

Decode base64 to PDF - Missing file extension

1

Hi,

I’m fairly new to the Mendix platform and I’m trying to decode a base64 string and download as a PDF.

I’ve created a mircoflow using CommunityCommons.Base64DecodeToFile to decode the string into a System.FileDocument parameter.

I then use the Download file action. However it downloads without a file extension. Once downloaded, if I add the “.pdf” extension the file opens without any issues.

Does anyone have any advice?

Thank you in advance,

Mark

 

asked
1 answers
1

Hi,

If you know its always going to be a pdf, then you can prepend the extension yourself. Once you convert your string to a document, in the same microflow use the change activity to append the pdf extension to the name. Then download the file. 

 

Edit: Here is an example

https://modelshare.mendix.com/models/81fc51bd-cd52-46bb-82b8-ba4dea4d6266/change-file-name

answered