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 / Copilot Studio / Unable to upload the f...
Copilot Studio
Suggested Answer

Unable to upload the file along with the HTTP request to my API in copilot studio

(0) ShareShare
ReportReport
Posted on by 5
Hi,
 
I'm trying to upload a file that the chat bot will ask and store it in a variable, and I wanted to upload the same with a simple HTTP request to my API, but apparently I could not find 
any option that would allow me to attach as such. Here's the flow I've build:

 
I have tried and tested setting all parameters, but no luck.
 
Any help is appreciated.
 
Thanks in advance!
I have the same question (0)
  • Suggested answer
    Artur Stepniak Profile Picture
    1,539 Super User 2025 Season 2 on at
    Hello,
     
    first of all, you're using `file` variable in the Content Type section - it's not correct. You also don't need to define Content-Type header separately as the Content Type field is for that purpose. You should use JSON in the body. Here's an example which you could use, it's from Power Automate, so you'd need to alter it a bit:
     
    {
      "$content-type": "multipart/form-data",
      "$multipart": [
        {
          "headers": {
            "Content-Disposition": "form-data; name=\"file\"; filename=\"@{utcNow('yyyyMMddHHmmss')}.pdf\""
          },
          "body": "@{body('Get_file_content')}"
        }
      ]
    }
     
    In case of any other questions, let me know. If the answer helped you, mark it, so that others can benefit from it.
     
    Best regards,
     
    Artur Stepniak
    Interested in GenAI? Visit my site!
  • AD-23121232-0 Profile Picture
    5 on at
    @Artur Stepniak Thanks for your reply! I have spent so many hours trying to figure out, even tried the snippet you gave, but I feel like it's not processing the variable as an object, instead as a string. Maybe because you shared the syntax for Power Automate? Is it possible there's some other syntax for it, or even it may not support this? 
     
    I just need to upload the file received to my API. Hope I find some solution!
     
    Thanks for the support, appreciate it.
     
    Best regards,
    Aum Dabke
     

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 > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 270 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 181 Super User 2025 Season 2

#3
S-Venkadesh Profile Picture

S-Venkadesh 93 Moderator

Last 30 days Overall leaderboard