Why is the App store Document Viewer widget corrupting a file upon download
Hi, I am trying to use Document Viewer from appstore, i.e. https://appstore.home.mendix.com/link/app/12/ I click the diagonal arrow icon below and download occurs but file is “corrupted” upon attempt to open. I see its size is only 1KB when it should be 1854KB and the “:” and backslash characters are replaced by underscores. Must I “escape” the colon and backslashes somehow? The pathname, size (1854KB) and other data are stored in an instance of System,FileDocument and show in debugger after creation as: What am I doing wrong? Goal is to get a file downloaded and displaying in a new window (not tab). Seems to “download” but corrupted. The original file opens fine as a Word document. Other files (pdf) I have tried are also corrupted as 1KB.
You cannot create a FileDocument from the modeler by using only a “Create Object “ action.
Use a widget like the File Manager to upload the document from your app and store it as a FileDocument.
Or, if FileDocument needs to be created from Microflow, you might use some of the Java actions from the community commons module, like FileDocumentFromFile, storeURLToFileDocument, StringToFile or Base64DecodeToFile.