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 / Copilot Studio / Uploading Image and Se...
Copilot Studio
Answered

Uploading Image and Sending it to Custom API

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi everyone,

I’m building an agent in Copilot Studio where a user can upload an image, and that image needs to be sent to a custom API hosted in Azure. The API should then return results that I can display back in the chat (for now as text, but ideally also as a processed image later).

I’ve created a topic in Copilot Studio that successfully collects the image from the user. I also set up an HTTP connector pointing to my API endpoint. However, I’m unable to send the image to the API—neither as base64 nor as multipart/form-data. The API receives the request, but the image data is always missing; only the other parameters appear in the request body.

I also tried uploading the image to SharePoint as a workaround, but that didn’t work either. SharePoint shows the error:

File type not supported. Select from HTML web pages (.html, .htm), PDF (.pdf), Word documents (.doc, .docx), Excel spreadsheets (.xls, .xlsx), PowerPoints (.ppt, .pptx), Text files (.txt, .md, .log), CSV (.csv), XML (.xml), OpenDocument files (.odt, .ods, .odp), EPUB (.epub), Rich Text Format (.rtf), Apple iWork documents (.pages, .key, .numbers), JSON (.json), YAML (.yml, .yaml), or LaTeX (.tex).

It appears JPG and PNG formats aren't supported in this context.

I would really appreciate any guidance, best practices, or workarounds that could help me pass the actual image content to my API or handle image uploads more effectively. I’m also happy to connect offline if needed.

Thank you!

Categories:
I have the same question (0)
  • Suggested answer
    Arild Aarnes Profile Picture
    565 Super User 2026 Season 1 on at
     
    Maybe you could show us your topic?
     
    You should be able to upload file to SharePoint by using the Upload File SharePoint Tool.

     
     
    Regards,
    Arild
  • PS-01021559-0 Profile Picture
    Microsoft Employee on at


    we will need to ask the question first right..? 
    So we can get the uploaded image in a var2 as file..? 

    I tried what you posted but somehow i am only getting var1 as record and not as file.
  • Suggested answer
    Arild Aarnes Profile Picture
    565 Super User 2026 Season 1 on at
    Hi @PS-01021559-0,

    If you collect the file using a question node as in your example, you do not need the Set variable node.
    You already have the file in a variable from the question node and can go directly to a Create file in SharePoint tool

     
    The reason you get the error about incorrect type is because the System.Activity.Attachments is a variable of type record, it contains both metadate about the file and the file content.
     
    Regards,
    Arild
  • PS-01021559-0 Profile Picture
    Microsoft Employee on at
    Tried it, it works nicely, thanks a lot! 
  • PS-01021559-0 Profile Picture
    Microsoft Employee on at


    Was thinking if I want to skip uploading that image to sharepoint and directly pass that to the API using this HTTP connector is there any way to do that, I tried diff ways to access image content but somehow it shows error: File Type is different and expects string. 

    Would really appreciate if you have some thoughts or workaround for this..? Just a thought might reduce certain topic steps and access issues going further 

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 277

#2
11manish Profile Picture

11manish 206

#3
sannavajjala87 Profile Picture

sannavajjala87 156 Super User 2026 Season 1

Last 30 days Overall leaderboard