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 / Create image from Base64
Power Automate
Unanswered

Create image from Base64

(0) ShareShare
ReportReport
Posted on by 115

I'm trying to create an image in Sharepoint based on the Base64 encoded data which I have received in JSON format.

 

This Base64 comes in as:

 

data:image/png;base64,iVBORw0KGgoAAAANSUh...

 

If I use DecodeBase64ToBinary on this, I get the error

The template language function 'base64ToBinary' was invoked with a parameter that is not valid. The value cannot be decoded from base64 representation.'.

 

However, if I remove 

 

data:image/png;base64,

 

from the start of the data, it works fine.

I thought this was needed as part of the Base64 data? It would be a pain if I have to remove it in order to decode it. 

Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    on at

    HI @DuncanIVH ,

     

    Please use datauritobinary instead of base64tobinlary if the string has a head like 'data:....'

     

    Best Regards,

    Wearsky

  • DuncanIVH Profile Picture
    115 on at

    Thanks @v-xiaochen-msft 

    I could have sworn I'd tried that already, but that fixed it!

  • ctrl_kudorje Profile Picture
    163 on at
    what about if the data is in PDF and starts like this? 
    JVBERi0xLjMKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiA

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 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard