How to upload attachments using HTTP on Power Automate?

jayman 0 Reputation points
2024-09-19T21:59:27.61+00:00

My flow is triggered by receiving an email that contains an attachment. I will then need to reference the contents of that attachment when creating a document record in my http step.

The body of my http request:

Screenshot 2024-09-19 165010

After running the flow, the dynamic content is showing bolded ?'s in the output. I would think this is the reason why my flow is failing.

Screenshot 2024-09-19 165241Screenshot 2024-09-19 165409

On the first attempt (with the same JSON body), the file contents showed none of these characters and everything ran smoothly. After that, these characters have showed up in every attempt and I have not had the flow succeed since. Does anyone know how to fix this?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
39,088 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Andrew Hall 80 Reputation points
    2024-09-20T00:26:32.43+00:00

    You don't specify which flavour of http action you are using (there are a few in power automate), but generally to avoid issues with attachments in http requests, you may want to use base 64 encoding. This will avoid any special characters withing the attachments that may invalidate json etc...

    You may want to look at either encoding it as base 64, or possibly the original raw email file would work as these are base 64 already.

    0 comments No comments

  2. Rakesh Gurram 7,870 Reputation points Microsoft Vendor
    2024-09-20T04:56:22.8133333+00:00

    Hi jayman,

    Thank you for reaching out to us on the Microsoft Q&A forum.

    This topic is currently not supported in the Q&A forums.

    I recommend initiating a new discussion through the Microsoft Power Automate Community Moderators are readily available there to assist you and provide guidance.

    Please don't forget to Accept helpful answer and close this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.