I have been stuck trying to be able to get a file from a document library that has been created or modified and create/update the file on an onprem file system (data gateway is configured correctly). I have been having no problems with .txt files, .csv files but .pdf .docx, .xlsx, and .pptx files. The file will be created (with correct file extension) but will get an error as such:
Here is my flow configuration:
Something to note** When I set the varFileContent variable base64(body('Get_file_content')) I still get the corrupted files.
If I try to make the set varFileContent to base64tobinary(body('Get_file_content')) I get an error that it is an object & that it needs to be in string format. Maybe I am doing string() conversions wrong, but I haven't had luck with that.
Any help would be great! Thanks.
Solved! Go to Solution.
This has been resolved. By starting a flow from scratch it was not forcing the "Get File Content" into a ForEach Loop, which then allowed me to use the "File Content" expression from GetFileConent directly, and did not have to integrate it into a variable.
May be worth noting. I changed the create file action in File System to OneDrive
The behavior is the same. A docx. file returns an error when opening:
Another update:
Just to test I changed the SP trigger of When a file is created in a folder and the System File "Create a File" action and the .docx fine created perfectly fine. The issue with this is that the "When a file is created in a folder" it does not include any nested folders:
This has been resolved. By starting a flow from scratch it was not forcing the "Get File Content" into a ForEach Loop, which then allowed me to use the "File Content" expression from GetFileConent directly, and did not have to integrate it into a variable.
Check out new user group experience and if you are a leader please create your group
See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.