I develop a logic app which should download a file from a remote location and store them in Share Point.
All files are png or gif files.
On the share point connector - upload file, I'm using binary(body('DOWNLOAD')) as input. However, the images are corrupt at Sharepoint.
Looked deeper it at, Logic App tries to parse the image as UTF-8 string which breaks the image.
Looking at hex level, the png looks different. test1x1.bad.png is the result at Sharepoint, test1x1.png is the original one.
$ xxd test1x1.bad.png | head -n 3
00000000: efbf bd50 4e47 0d0a 1a0a 0000 000d 4948 ...PNG........IH
00000010: 4452 0000 00ef bfbd 0000 00ef bfbd 0803 DR..............
00000020: 0000 00ef bfbd efbf bdef bfbd efbf bd00 ................
$ xxd test1x1.png | head -n 3
00000000: 8950 4e47 0d0a 1a0a 0000 000d 4948 4452 .PNG........IHDR
00000010: 0000 0080 0000 0080 0803 0000 00f4 e091 ................
00000020: f900 0002 7350 4c54 45ff ffff 3333 3333 ....sPLTE...3333
How I can avoid that Logic App parse the body as UTF-8 String?
I also tried body('DOWNLOAD') and base64ToBinary(body('DOWNLOAD')['$content']), but there is no difference. body('DOWNLOAD')['$content'] returns a base64 value of the image.





