cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
alexco
Advocate I
Advocate I

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
Advocate I
Advocate I

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
Advocate I
Advocate I

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

ReflexConsultin
Frequent Visitor

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

Anonymous
Not applicable

Figured it out!!! Just use the thumbnail. 

Flow.GIF

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (2,344)