cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Iro_
Helper III
Helper III

Upload a file or Image Dataverse Action - File is empty

Hello,

 

I am using Upload a file or Image Dataverse Action to create a file in dataverse.

Here are the ways I've used to fill in the Content field:

 

 

{
"$content-type": "application/pdf;base64",   // also tried without "base64" 
"$content": "JVBERi0xLjMNCjEgMCBvYmoNClsvUERGIC9UZXh0IC9JbWFnZUIgL0ltYWdlQyAvSW1hZ2VJXQ0KZW5kb2JqDQo0IDAgb2JqDQo8PCAvTGVuZ...="  // also tried without using quotes
}

 

 

 

{
"$content-type": "application/pdf;base64", // also tried without "base64"
"$content": "@{base64ToBinary(JVBERi0xLjMNCjEgMCBvYmoNClsvUERGIC9UZXh0IC9JbWFnZUIgL0ltYWdlQyAvSW1hZ2VJXQ0KZW5kb2JqDQo0IDAgb2JqDQo8PCAvTGVuZ...=)}"
}

 


The pdf is always empty.

I've checked the base64 string in an online base64 to PDF convertor and it is correct, it produces a pdf file.

 

Any help would be much appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Iro_ now it worked and the file opened with no issues.

 

Add a compose and use the base64ToBinary function. As parameter pass the file content that you have 

JVBER .....

 

Add the output from compose to the content parameter

 

rohentz_0-1663770409755.png

 

Best regards

 

Rodrigo Hentz

Microsoft Power Platform Support Engineer

 

View solution in original post

7 REPLIES 7
rohentz
Community Support
Community Support

Hi @Iro_ how are you?

 

@Iro_ could you please provide an image from your flow? What actions are using? Where the file comes from?

 

I did a small sample here creating the column and also an instant flow passing a file as argument, and it worked

 

rohentz_0-1663765690969.png

 

rohentz_1-1663765715562.png

 

Best regards

 

Rodrigo Hentz

Microsoft Power Platform Support Engineer

 

 

 

 

Hello @rohentz 

 

Here is an image from the flow:

 

Iro__0-1663766485154.png

 

The file is in base64 string format and I get it from a child flow.

 

Thank you

rohentz
Community Support
Community Support

Thnkas @Iro_ 

 

Did you already try to add the text directly? At my test below it worked

 

rohentz_0-1663766933853.png

 

Best regards

 

Rodrigo Hentz

Microsoft Power Platform Support Engineer

 

Yes, I've already tried to add the text directly.

In that case, the file does not even open:

 

Iro__0-1663768745559.png

 

Thank you

rohentz
Community Support
Community Support

Hum let me check this @Iro_ 

 

Best regards

 

Rodrigo Hentz

Microsoft Power Platform Support Engineer

Hi @Iro_ now it worked and the file opened with no issues.

 

Add a compose and use the base64ToBinary function. As parameter pass the file content that you have 

JVBER .....

 

Add the output from compose to the content parameter

 

rohentz_0-1663770409755.png

 

Best regards

 

Rodrigo Hentz

Microsoft Power Platform Support Engineer

 

It worked like a charm, thank you!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,239)