web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Moving email attachmen...
Power Automate
Suggested Answer

Moving email attachment to WebDav via HTTP Put corrupts the file

(2) ShareShare
ReportReport
Posted on by 11
 
Hi, 
 
I am trying to move files from emails to a WebDav folder; but the file arrive has content changed to text and characters. I have tried using e.g pdf or csv - same thing happens.
 
I have included the flow and output image - any suggestion would be gratefully received.
 
thanks
 
Output
 
 
Categories:
I have the same question (0)
  • Suggested answer
    trice602 Profile Picture
    15,404 Super User 2025 Season 2 on at
    Hi,
     
    The root cause here is converting your content bytes dynamic content into a form submission.  Here's an example:
     
    {
      "$content-type": "multipart/form-data",
      "$multipart": [
        {
          "headers": {
            "Content-Disposition": "form-data; name=\"file\"; filename=\"example.pdf\""
          },
          "body": "@{base64ToBinary(outputs('Get_file_content')?['body']?['$content'])}"
        },
        {
          "headers": {
            "Content-Disposition": "form-data; name=\"additionalParameter\""
          },
          "body": "parameterValue"
        }
      ]
    }
     
     
    It seems like every webservice is slightly different in regards to the headers and exact format but I would start with just adding the expression base64ToBinary() and see if that solves it; otherwise you will need to figure out what the requirements are for the web service you are posting to and modify the body of your http request to something similar to the above.  I just went through this exercise with one of my flows.
     
     

    ------------------------------------------------

     

     

    ⭐ If this was helpful, please like and mark as a verified answer to help others find this too!

     

     

    Always glad to help! 💯💯💯💯💯

     

    Tom

     

    Follow me on LinkedIn - Thomas Rice, PMP | LinkedIn

  • MitaSaxena Profile Picture
    11 on at
    Thank you for getting back to be me.. tried the option but it is a new different content. I take on board your comment on requirements and will investigate further. Thanks again.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard