You can return those files, but you need to make sure that you return the correct headers, especially Content-Type
For .docx, set Content-Type to generatorapplication/vnd.openxmlformats-officedocument.wordprocessingml.document
For .xlsx, set Content-Type to application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
For an overview of Microsoft's mime types, see https://docs.microsoft.com/en-us/previous-versions/office/office-2007-resource-kit/ee309278(v=office.12)
Just for clarification, to add a header, add a 'Create Object' action to your microflow and choose System.HttpHeader. Set the HttpHeaders association to the HttpResponse, and set the Key and Value properties. (Key is the name of the header, so in this case 'Content-Type')
You can change the way the browser handles the file (as a download or viewing inside the browser) with the Content-Disposition header
Hi Joost. Thanks for your answer!
How do you translate the filedocument to the "Content" field of the HTTP Response? This should be a string. Do you use the CommunityCommons Java-action StringFromFile? Or should I do this differently?
I've set the following headers: