cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
alexco
Level: Powered On

Get File Content as Base64

I am trying to retrieve a SharePoint file’s content as base64.

I'm using the "Get file content" Action which returns the file as binary. 

 

I've tried using the Compose Action with the following expression: @base64(string(body('Get_file_content')))

This differs from the Base64 representation that I get when doing this directly on the file (so not through Flow). 

 

What am I doing wrong? Is there an easier way of doing this?

 

If I just use the binary representation I just get something like this:

"[....]��(��U�N�0�#����q !Ԕ�# Q$���i-��w ��٤$ (-�DJ���ƣ�gg�GHh�/[....]" so I definitely need to transform it somehow before using it further.

1 ACCEPTED SOLUTION

Accepted Solutions
alexco
Level: Powered On

Re: Get File Content as Base64

Update: I found the solution. I should have used @base64(body('Get_file_content')) expression (without the string conversion). The Compose Action step is also unnecessary.

View solution in original post

3 REPLIES 3
alexco
Level: Powered On

Re: Get File Content as Base64

Update: I found the solution. I should have used @base64(body('Get_file_content')) expression (without the string conversion). The Compose Action step is also unnecessary.

View solution in original post

Highlighted
ReflexConsultin
Level: Powered On

Re: Get File Content as Base64

I was researching this as well. Although the answer suggested didn't work for me - i wanted to share that I was able to create an HTML file using basic code and inserted the base64 code in it. Then i found the new OneDrive Conversion function and managed to convert it and save it as an image with which i could update a Hyperlink column with a link to this newly created image. There might be quicker ways - but as a non programmer, it's the result that matter 🙂 

Hope this helps.

FlowSetupFileConversion.jpg

pbunyan22
Level: Powered On

Re: Get File Content as Base64

Figured it out!!! Just use the thumbnail. 

Flow.GIF

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 314 members 5,624 guests
Please welcome our newest community members: