Diff: [root] @ d71611b7068 | faq | css

script & api

File created: dump/api [Diff]

-- /dev/null++ b/dump/api
@@ -1 +1,36 @@
h1. How to use dump.bitcheese.net to asynchronously upload files

1. Generate an unique token for your upload, sending GET request to @http://dump.bitcheese.net/gentoken@

bc. % curl http://dump.bitcheese.net/gentoken
nuxyzud<...>umonuso

2. Add this token as @token@ form field when uploading a file

bc. % curl -F file=@file -F token=nuxyzud<...>wyfumonuso http://dump.bitcheese.net/upload-file?simple
http://dump.bitcheese.net/files/urobos/

3. If you want to query progress of file upload, you can send GET request to @http://dump.bitcheese.net/gettoken/$token@

bc. curl http://dump.bitcheese.net/gettoken/nuxyzu<...>fumonuso

This returns either an empty string (if file isn't uploaded yet or token doesn't exist) or relative path to file, like @files/urobos/file@

@gentoken@ and @gettoken@ are also available in JS format, just append "?format=js" to URI:

bc. % curl http://dump.bitcheese.net/gentoken?format=js
uploader.callback("nuxyzud<...>umonuso");

bc. % curl http://dump.bitcheese.net/gettoken/nuxyzud<...>umonuso?format=js
uploader.callback("images/uwegyra/font.png", {
"url":"http://dump.localhost/images/uwegyra/font.png/preview",
"name":"font.png",
"size":1186,
"file":"http://dump.localhost/images/uwegyra/font.png",
"pixelsize":[164,36],
"thumbsize":[400,88],
"thumb":"http://dump.localhost/images/uwegyra/thumb/font.png"
});

Fields should be self-descriptive.

File: dump/index [Diff]

-- a/dump/index++ b/dump/index
@@ -1,3 +1,6 @@
api - Description of API for using dump.bitcheese.net from other sites
script - Shell script to use dump.bitcheese.net from command line

h1. dump.bitcheese.net description

toc.

File created: dump/script [Diff]

-- /dev/null++ b/dump/script
@@ -1 +1,2 @@
:https://gist.github.com/221804

By Voker57 on 2012-02-03 17:37:38 +0000