Skip to main content
Community site session details

Community site session details

Session Id : kH4QkwxuvlMg4d2PzcpXoM
Power Automate - Building Flows
Unanswered

HTTP request to upload file Base64

Like (0) ShareShare
ReportReport
Posted on 15 Oct 2022 15:22:51 by 14

Hi, this si my first post so i say hello to everyone.

I'm trying to upload a file using HTTP action.

the spcification are:
2 parameters:

id = Item unique id (i.e. 7813)

images = array of objects with 2 nodes: "name" = name of the file and "content" = base64 file content

I'm trying the following flow:

 

vigand_3-1665847110460.png

 

I receive the following error:

Http request failed: the content was not a valid JSON. Error while parsing JSON: 'Unexpected character encountered while parsing value: <. Path '', line 0, position 0.'

 

Where is the error?

Thank you very much for your help.

 

Regards

 

Andrea

 

  • Nimash_Eshan Profile Picture
    2 on 07 Jun 2024 at 10:55:09
    Re: HTTP request to upload file Base64

    Get file content action are already base64

    Nimash_Eshan_2-1717757273851.png

    You can simply use,

    body('Get_file_content').$content

     

    Nimash_Eshan_0-1717756943214.png

  • vigand Profile Picture
    14 on 06 Nov 2022 at 21:03:15
    Re: HTTP request to upload file Base64

    Hi,

     

    just a quick update.

     

    I was able to get the http action working only with the form-urlencoded Content-Type and passing the various parameters by replacing the special characters using the encodeURIcomponent command.

     

    No success using multipart conte-type. Obviously the formatting to be put as Body must be particular and I don't know how I have to manage it.

     

    I can confirm that urlencoded just work.


  • vigand Profile Picture
    14 on 20 Oct 2022 at 20:34:38
    Re: HTTP request to upload file Base64

    Hi,

     

    unfortunately this doesn't solve the issue. Still receiving the same error message.

    I've tried to use Postman to send the same request and it works.




  • Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on 16 Oct 2022 at 13:35:19
    Re: HTTP request to upload file Base64

    @vigand 

    Hi there.  Did you already try wrapping the Output dynamic value in quotes?  Kind of like this:

    edgonzales_0-1665927294555.png

    If not, give that a go and let us know how it works out.

    Good luck!

    -Ed

     

    If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Loading complete