downloading file from SharePoint API in Mendix FileDocument
Hi, I’m trying to implement a connection from Mendix to Sharepoint. I already managed to send files uploaded in Mendix to sharePoint (as binary). However now Im trying to download filed for the same SharePoint site to show them as PDF. The file is send as binary to Mendix, but for some reason the PDF file shows the number of pages corrrectly , but the name and content of the file seems too be missing. In other words i just get blank pages. I use the Store in a file document option as response type for my REST call, but I guess something goes wrong when mendix stores this content. Even though it states in the documentation ; If the response contains binary content (for example, a PDF), it can be stored in an object of an entity t ype which inheritsfrom System.FileDocument Anyone have any clue what could be the issue here? Edit 06/08/2020: Solved the issue. Apparently if you have the REST consume logging put to trace (to be able to see the request response) the binary response gets converted to a string to be able to show it in the logging and then offcourse the binary response is no binary anymore. Thus making the store in file to fail conversion from binary to a file. Long story short. Setting the REST consume log level back to info solved the issue.
Are you sure the file you uploaded is stored intact on sharepoint?
if you use a GET operation on the download URL received from Sharepoint and use the ‘Store in a file document’ option as response handling it should just work fine.