Mapper Parsing Exception in elasticsearch

You have to generate BASE64 strings without Line breaks.
I'm not saying you should remove line breaks in files themselves.

Instead of sending incorrect JSON like:

"field": "AAAAAAAAAAAA
AAAAAAAAAA"

Send:

"field": "AAAAAAAAAAAAAAAAAAAAAA"