Skip to main content

Notifications

Power Automate - Using Connectors
Unanswered

Convert image to base64 and pass it as a variable in POST Request

(0) ShareShare
ReportReport
Posted on by

I'm converting image to base 64 stored in sharepoint using the formula :

 

vBase64Content= outputs('Get_file_content')?['body']?['$content'] 

 

Then passing the binary value of image in an POST Request as:

 

"type": "image_url",

"image_url": {

"url": "data;image/jpeg;base64,&vBase64Content&",

"detail": "high"}

 

Error:Bad Request 

Status code - 400

"Invalid base64 image_url."

 

When I'm checking the value of image it shows correct but still it is not running .

Let me know what is the issue.

 

Thanks,

Adi

 

  • ManishSolanki Profile Picture
    ManishSolanki 15,075 on at
    Re: Convert image to base64 and pass it as a variable in POST Request

    Hi Adi,

     

    You could refer below sample:

    ManishSolanki_0-1704691672014.png

    Expression used for adding base64 content in compose action:

    body('Get_file_content_using_path')?['$content']

    You could pass the output of compose action in the body of http action.

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,691

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 65,019

Leaderboard

Featured topics