Skip to main content

Hi All,

 

I have to convert base64 encoded binary data to file (pdf or zip). I have used the Mule decoder transformer to decode and store in as file. But the decoder transformer only works with mule 3.9 version, what can be done in Mule 4? Once it is decoded, I have to convert it to java.io.inputstream and send it to sharepoint.

 

Any suggestions would be highly appreciated.

7 Antworten
  1. 19. Mai 2019, 09:05

    Hey @ryanandal

     

    I was able to solve it, there were few extra spaces in the encoded input JSON and that's why it was failing, but the real problem still exists, the input base64 encoded string which I am trying to decode is a pdf file(encoded to base 64), when I decode it I get a huge string like this ' \ufffd\ufffd\ufffd\ufffd|\ufffd_/\ufffd\ufffd\ufffd\ufffd\ufffd}K\ufffd_/\u0011\ufffd> ', I am not sure how to handle this output, the use case I have to complete is to decode the base 64 string and write it to a sharepoint library using sharepoint connector, but the output I am getting is not containing any content except the values that I have pasted above.

    The decoder used in dataweave is able to decode that the given encoded string is a pdf but the actual content is represented as unicode characters(ufffd), do I need to do something else or just place this output to sharepoint connector? Glad if you could suggest something here.

    Attach file sharepoint connector:

    Hey @ryanandal I was able to solve it, there were few extra spaces in the encoded input JSON and that's why it was failing, but the real problem still exists, the input base64 encoded string which I a

     

    or

     

    File add sharepoint connector:

    1.jpg

     

    These both connectors expect a file content stream.

     

0/9000