# Error putting base64 converted string into Elasticsearch

**URL:** <https://discuss.elastic.co/t/error-putting-base64-converted-string-into-elasticsearch/61595>\
**Category:** Elasticsearch\
**Created:** [September 27, 2016, 10:41am UTC](https://discuss.elastic.co/t/error-putting-base64-converted-string-into-elasticsearch/61595 "2016-09-27T10:41:13Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 29, 2016, 12:00pm UTC](https://discuss.elastic.co/t/error-putting-base64-converted-string-into-elasticsearch/61595/6 "2016-12-29T12:00:34Z")

</div>

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will make your post more readable.

Probably you should run something like:

```auto
var=$(base64 "$filename"| perl -pe 's/\n//g');
var1=$(curl -XPOST 'http://localhost:9200/reports-'$date'/document/reports?pipeline=attachment&pretty' -H "Content-Type: application/json" -d @- <<CURL_DATA
{ "data": "$var" }
CURL_DATA)

```

---

_[View the full topic](https://discuss.elastic.co/t/error-putting-base64-converted-string-into-elasticsearch/61595)._
