Hi,
I'm relatively new to Power Automate and have spent the last day designing a flow that will automate an invoice approvals process. For some reason, when I add the file (pdf) that has been sent for query as an attachment, the authoriser cannot open it, getting the error message in acrobat Pdf viewer below:
Adobe Acrobat could not open '(FileName)' because it is either not a supported file type or because the file has been damaged (for example, if it was sent as an email attachment and wasn't correctly decoded).
I have attached screenshots of the flow I have built and the parameters of both the 'get content' action and the send for auth action.
I wish to point out that my organisation had one that worked previously however as our sharepoint site has evolved, it is now failing.
Also, I cannot use a link to the file instead as sharing is not allowed on our sharepoint site due to GDPR regulations.
Any help towards getting this to work would be greatly appreciated and if anyone needs anything else please let me know.
Hi @SamLed,
Thanks for your response, I tried both versions within the JSON and I can now open the attachment in Adobe Acrobat (using the convert to binary option). However, it appears that the actual content of the file is not being pulled through as the PDF is just a blank page. If you have any idea how to fix this your advice would be greatly appreciated.
edit: I got it to work, I had left the quotations around the content by accident.
Thanks.
Hi @TomCarson-Mee,
Check out "Get file content from path" output, I'm pretty sure file content is Base64 encoded. Give a try replacing "File content" dynamic content by expression: base64ToString(outputs('Get_file_content_using_path')?['body']['$content']) in your Attachment item JSON.
[Edit] As it is PDF, that may be base64ToBinary(outputs('Get_file_content_using_path')?['body']['$content'])
If I have answered your question, please Accept the post as solution.
If you like my response, please Thumbs Up.