About EasyMorph Tutorials & Examples Web-help

Encoding a file with BASE64

What would be the proper/best way to encode a file content with BASE64 and post it using Web Request action. Is there any size limitation for Posting a data with Web Request? My concern is that some files might be pretty big couple of dozen MB.

Hi Bolud,

The best way depends on the file type and the target API.

EasyMorph has the encode() function which can be used to encode text to BASE64.

If you need to send a text file, you can:

  • import that file to EasyMorph with the “Import delimited text action” (separator should be set to “No separator” and “Treat numeric values” should be set to “Always as text”)
  • use the “Aggregate” action to concatenate all the lines
  • encode result to BASE64
  • use the “Iterate Web Request action” to send encoded text.

But there is no simple way to import the content of a binary file to EasyMorph.
So in case of a binary file, it’s better to use the “Run command” action with a thrid-party utility or the “PowerShell” action with a PowerShell script to convert that file.

And if the file should be sent as a multipart form data, you can you the “Web request” action to send it. In other case it’s better to use the “PowerShell” action to send the request.

In any case, a couple of dozens MB should not be a problem for the “Web request” action.

Hi @bolud
Could you please specify which web service are you going to use or place a link to the web service documentation?

I have some pdf files to upload using REST API was wondering f it was possible. The purpose is first POST data then upload corresponding PDF files using the REST response id’s.

To learn more about EasyMorph visit easymorph.com.