This shows you the differences between two versions of the page.
thevoid:elliptics [2013/10/23 20:55] elessar created |
thevoid:elliptics [2013/10/23 21:02] (current) elessar |
||
---|---|---|---|
Line 57: | Line 57: | ||
* **name** - key to read from | * **name** - key to read from | ||
+ | ==== on_upload ==== | ||
+ | |||
+ | Write file to storage. | ||
+ | |||
+ | Query parameters: | ||
+ | * **name** - key to write into | ||
+ | * **id** - read data by specified hex-encoded **id** instead of name | ||
+ | * **offset** - write into file by offset | ||
+ | * **prepare** - prepare enough space for next **plain-write** and **commit** commands and write first chunk | ||
+ | * **plain-write** - write chunk to file | ||
+ | * **commit** - finish serial of plain-write commands, must be equal to final file size | ||
+ | |||
+ | Returns JSON with information where file is written to: | ||
+ | |||
+ | <file javascript> | ||
+ | { | ||
+ | "info": [ | ||
+ | { | ||
+ | "id": "a5c12c102bdaed8ee80168cb41606295eaf5512ba04045fac5dd0dc65c2f54f13566090025c05f14cdfdf9b1e39ce835c6f3262a4aedba31f8b6d07ed299b23b", | ||
+ | "csum": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", | ||
+ | "filename": "/tmp/blob/data-0.0", | ||
+ | "size": 37, | ||
+ | "offset-within-data-file": 13717, | ||
+ | "mtime": { | ||
+ | "time": "2013-10-23 MSK 14:43:25.000000", | ||
+ | "time-raw": "1382525005.0" | ||
+ | }, | ||
+ | "server": "127.0.0.1:1025" | ||
+ | } | ||
+ | ], | ||
+ | "time": "1382525005" | ||
+ | } | ||
+ | |||
+ | </file> |