# Is it possible to get attachments as binary stream?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-get-attachments-as-binary-stream/6010>\
**Category:** Elasticsearch\
**Created:** [November 29, 2011, 1:03pm UTC](https://discuss.elastic.co/t/is-it-possible-to-get-attachments-as-binary-stream/6010 "2011-11-29T13:03:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vsiryi](https://avatars.discourse-cdn.com/v4/letter/v/7ab992/32.png) [@vsiryi](https://discuss.elastic.co/u/vsiryi)\
**Post date:** [November 29, 2011, 1:03pm UTC](https://discuss.elastic.co/t/is-it-possible-to-get-attachments-as-binary-stream/6010/1 "2011-11-29T13:03:43Z")

</div>

I have not seen such possibility in the documentation. This question I ask to be sure that it can not be done.  
As I understand, ES does not store the attachments in binary. ES get attachment as base64 stream from JSON and index it.

Thanks!  
Best regards, Vitalii Siryi

---

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [December 2, 2011, 11:37am UTC](https://discuss.elastic.co/t/is-it-possible-to-get-attachments-as-binary-stream/6010/2 "2011-12-02T11:37:44Z")

</div>

Hi,

AFAIK it is not possible. You get Base64 encoded content from \_source which  
you have to decode on your side.

Regards,  
Lukas

On Tue, Nov 29, 2011 at 2:03 PM, vsiryi [vitalii.siryi@gmail.com](mailto:vitalii.siryi@gmail.com) wrote:

> I have not seen such possibility in the documentation. This question I ask  
> to  
> be sure that it can not be done.  
> As I understand, ES does not store the attachments in binary. ES get  
> attachment as base64 stream from JSON and index it.
> 
> Thanks!  
> Best regards, Vitalii Siryi
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/Is-it-possible-to-get-attachments-as-binary-stream-tp3545099p3545099.html](http://elasticsearch-users.115913.n3.nabble.com/Is-it-possible-to-get-attachments-as-binary-stream-tp3545099p3545099.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<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 2, 2011, 11:44am UTC](https://discuss.elastic.co/t/is-it-possible-to-get-attachments-as-binary-stream/6010/3 "2011-12-02T11:44:38Z")

</div>

I don't think it's possible as you can't put binary in a JSON content.  
What is your use case ?

David 😉  
@dadoonet

Le 29 nov. 2011 à 14:03, vsiryi [vitalii.siryi@gmail.com](mailto:vitalii.siryi@gmail.com) a écrit :

> I have not seen such possibility in the documentation. This question I ask to  
> be sure that it can not be done.  
> As I understand, ES does not store the attachments in binary. ES get  
> attachment as base64 stream from JSON and index it.
> 
> Thanks!  
> Best regards, Vitalii Siryi
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/Is-it-possible-to-get-attachments-as-binary-stream-tp3545099p3545099.html](http://elasticsearch-users.115913.n3.nabble.com/Is-it-possible-to-get-attachments-as-binary-stream-tp3545099p3545099.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![Goog\_Jobs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/goog_jobs/32/2894_2.png) [@Goog\_Jobs](https://discuss.elastic.co/u/Goog_Jobs)\
**Post date:** [December 3, 2011, 10:14am UTC](https://discuss.elastic.co/t/is-it-possible-to-get-attachments-as-binary-stream/6010/4 "2011-12-03T10:14:11Z")

</div>

In couchdb, the attachments can be uploaded in binary and can be indexed by  
ES.

2011/11/29 vsiryi [vitalii.siryi@gmail.com](mailto:vitalii.siryi@gmail.com)

> I have not seen such possibility in the documentation. This question I ask  
> to  
> be sure that it can not be done.  
> As I understand, ES does not store the attachments in binary. ES get  
> attachment as base64 stream from JSON and index it.
> 
> Thanks!  
> Best regards, Vitalii Siryi
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/Is-it-possible-to-get-attachments-as-binary-stream-tp3545099p3545099.html](http://elasticsearch-users.115913.n3.nabble.com/Is-it-possible-to-get-attachments-as-binary-stream-tp3545099p3545099.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<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:** [July 6, 2017, 3:46am UTC](https://discuss.elastic.co/t/is-it-possible-to-get-attachments-as-binary-stream/6010/5 "2017-07-06T03:46:33Z")

</div>


