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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Send multi-part form d...
Power Automate
Answered

Send multi-part form data with flow HTTP task

(1) ShareShare
ReportReport
Posted on by 38

Hi,

 

I have to repost this question as this forum had an issue with my original post.

I'm struggling with multi-part form data. I need to send a binary file to REST API with plain HTTP and no json data.

How is this possible with the flow HTTP task?

 

It's also not possible to upload an image here.

Please see screenshot in link: Flow Task 

 

 

Categories:
I have the same question (0)
  • v-bacao-msft Profile Picture
    Microsoft Employee on at

     

    Hi @SvenG ,

     

    Which API do you currently use, and are there any documents for reference?

     

    Best Regards,

  • SvenG Profile Picture
    38 on at

    Hi @v-bacao-msft 

     

    I'm using this API and try to upload a file. They have working example of curl and postman.

     

    Thanks for your support

    Sven

     

     

    Edit, the question now is:

    What's the correct flow task setup for the following curl command:

    curl https://api.lexoffice.io/v1/files
    -X POST
    -H "Authorization: Bearer {accessToken}"
    -H "Content-Type: multipart/form-data"
    -H "Accept: application/json"
    -F "file=@{PathToImage}" -F "type=voucher"

     

  • Verified answer
    SvenG Profile Picture
    38 on at

    While searching through similar post here I came to some conclusions. 

    What I've found out so far is that one can use a special json syntax for the HTTP body.

     

     

    I got it working now:

     

     

    {
     "$content-type": "multipart/form-data",
     "$multipart": [
     {
     "headers": {
     "Content-Disposition": "form-data; name=\"file\"; filename=\"test.pdf\""
     },
     "body": {
     "$Content-type": "@{items('Auf_alle_anwenden')?['ContentType']}",
     "$content": @{items('Auf_alle_anwenden')?['ContentBytes']}
     }
     },
     {
     "headers": {
     "Content-Disposition": "form-data; name=\"type\""
     },
     "body": "voucher"
     }
     ]
    }

     

     

    There was an issue that the API accepts only binary data.  I could resolve it by removing the base64 encoding found in a similar thread.

     

    It's really bad that there is no documentation about the HTTP task at all. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 589

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 284 Super User 2026 Season 1

Last 30 days Overall leaderboard