# Inserting PDF's and PPT's into 5.1.1 failing ingest attachment - not\_x\_content\_exception

**URL:** <https://discuss.elastic.co/t/inserting-pdfs-and-ppts-into-5-1-1-failing-ingest-attachment-not-x-content-exception/70934>\
**Category:** Elasticsearch\
**Created:** [January 9, 2017, 10:31am UTC](https://discuss.elastic.co/t/inserting-pdfs-and-ppts-into-5-1-1-failing-ingest-attachment-not-x-content-exception/70934 "2017-01-09T10:31:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![maddazzaofdudley](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@maddazzaofdudley](https://discuss.elastic.co/u/maddazzaofdudley)\
**Post date:** [January 9, 2017, 10:31am UTC](https://discuss.elastic.co/t/inserting-pdfs-and-ppts-into-5-1-1-failing-ingest-attachment-not-x-content-exception/70934/1 "2017-01-09T10:31:19Z")

</div>

Guys

I'm stuck....

I'm trying to index some PDF's and PPT's in Elastic as follows

curl -H 'Content-Type: application/pdf' -XPUT https://????.eu-west-1.aws.found.io:9243/aggregator/doc/7?pipeline=attachment --data-binary @ixluokdn000991d90edmxwa1.pdf

and get the following response

{  
"error": {  
"root\_cause": [  
{  
"type": "not\_x\_content\_exception",  
"reason": "Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"  
}  
],  
"type": "not\_x\_content\_exception",  
"reason": "Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"  
},  
"status": 500  
}

It works fine if the content is a base64 string....

I've tried reading the docs but for some reason I cannot see where I am going wrong

Thanks in advance

Darren

---

<div class="post-metadata">

**Author:** ![cstrzadala](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cstrzadala/32/8211_2.png) [@cstrzadala](https://discuss.elastic.co/u/cstrzadala)\
**Post date:** [January 11, 2017, 4:02am UTC](https://discuss.elastic.co/t/inserting-pdfs-and-ppts-into-5-1-1-failing-ingest-attachment-not-x-content-exception/70934/2 "2017-01-11T04:02:08Z")

</div>

Hi @maddazzaofdudley,

I've moved this to the Elasticsearch forum as it's more related to ingesting data than cloud.

Christian

---

<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:** [January 11, 2017, 6:29am UTC](https://discuss.elastic.co/t/inserting-pdfs-and-ppts-into-5-1-1-failing-ingest-attachment-not-x-content-exception/70934/3 "2017-01-11T06:29:36Z")

</div>

You can't upload a binary doc as is to elasticsearch but you need to provide a json document as explained in the docs.

Note that FSCrawler project is coming soon with such an upload feature.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 14, 2017, 6:29am UTC](https://discuss.elastic.co/t/inserting-pdfs-and-ppts-into-5-1-1-failing-ingest-attachment-not-x-content-exception/70934/4 "2017-01-14T06:29:40Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
