0

Is it really possible to upload image using Crate Blob table. i found this link (https://crate.io/docs/reference/blob.html) which is able to upload text on blob table.

Similarly, i am looking to upload images to crate Blob table. I didn't find the way to do this. Can somebody help on this.

Thanks, Ramesh

Jodok Batlogg
  • 373
  • 1
  • 9
Ramesh_D
  • 689
  • 1
  • 7
  • 25

1 Answers1

6

Yes it is possible to upload all kind of binary files including images to a blob table.

For example with curl you can use:

 curl -v -XPUT localhost:4200/_blobs/foo/3b31733584613967a14d5a9ef530fbdc750c09cf --data-binary @/tmp/screenshot.png                                                                                 

(The hash has to be generated beforehand, for example using sha1sum:

sha1sum /tmp/screenshot.png

The python client for example also has built-in blob support:

https://crate.io/docs/reference/python/blobs.html

Jodok Batlogg
  • 373
  • 1
  • 9
mfussenegger
  • 3,931
  • 23
  • 18
  • Thank you very much. I did it with help of your above information. Added uploadBlob method on https://github.com/LeisureTime/Crate-php-Client/blob/master/Crate.php. – Ramesh_D May 13 '14 at 10:21