I’ve made an app to test file upload functionality towards a sharepoint document library, using a flow to create the file on sharepoint.
It went smooth and worked as expected, I tested two components to select the files, being an ‘attachments’ control, and a MediaButton control (it’s call ‘add picture’ in the GUI).


Both buttons call the same flow called SendFileToFlow using the code below which stores the file on sharepoint.
Set(FilePath2, SendFiletoFlow.Run(
{ file:
{ name: Last(Upload1.Attachments).Name
, contentBytes:Last(Upload1.Attachments).Value
} }
));
Set(FilePath1, SendFiletoFlow.Run(
{file:
{ name:Upload.FileName
, contentBytes:Upload.Media
}}
));

I had a nasty surprise when I tried the same code in the production app. It doesn’t work.
Now whenever I copy this working code into a new app, in conjunction with the very same flow, I get this exactly the same error message for each control:

So now I’m trying to understand why code is right in one app and wrong in the other.
I would assume since the contentBytes ‘type’ in the upload is set by the control it must be the same in every app!
How can I troubleshoot this further?
Thanks for any response.
While browsing the forums I found someone suggesting to add an odata type to the statement.

It doesn't seem to help, but maybe I did not get it correctly.
Michel
In both the working and the failing case the control.Attachments.Name and the control.Attachments.Value of the attachments return this:
secretstuff.pdf
appres://blobmanager/1c18e61fbcf34bc4a9dd9bfed5706806/1