curl --upload-file image.jpg http://localhost:9999/upload/hash
createdb vfs
psql -f docs/vfs.sql vfs
mkdir testdata
make run
wget -O image.jpg https://media.myshows.me/shows/e/22/e22c3ab75b956c6c1c1fca8182db7efb.jpg
export AUTHTOKEN=`curl http://localhost:9999/auth-token`
curl --upload-file image.jpg -H "AuthorizationJWT: ${AUTHTOKEN}" http://localhost:9999/upload/hash
open http://localhost:9999/media/6/4a/64a9f060983200709061894cc5f69f83.jpg
HTTP Params:
- ns: namespace, default is ""
- ext: file extension, default is "jpg".
jpeg
or<empty>
will convert tojpg
.
- Default namespace and default extension (jpg):
curl --upload-file image.jpg http://localhost:9999/upload/hash
- Specific namespace (test):
curl --upload-file image.jpg http://localhost:9999/upload/hash?ns=test
- Specific namespace (test) with file extension:
curl --upload-file image.gif http://localhost:9999/upload/hash?ns=test&ext=gif
- Default namespace and default extension (jpg):
curl -F '[email protected]' http://localhost:9999/upload/hash
- Specific namespace (test):
curl -F '[email protected]' http://localhost:9999/upload/hash?ns=test
- Specific namespace (test) with file extension:
curl -F '[email protected]' http://localhost:9999/upload/hash?ns=test&ext=gif