NOTE
The service is now invite-only. Please send an email at hello@chunk.io if you’d like to get access to the service.
$ curl -u user:pass -T path/to/file https://chunk.io
https://chunk.io/crohr/f1ec04b3586f415d9ae4cac7bbe64826
Tired of having to open a web browser to upload some files and make them available to people on the Web? Don’t want to remember a complicated API to do it on the command line? chunk.io is designed to be the simplest way to upload a file from the command line.
If your system does not have cURL, go install it right now.
Every web site that allows you to upload files either requires you to open a web browser, and/or provides an API that’s just too complicated to be usable from the command-line. chunk.io solves this, and more:
Upload any kind of file, not just text files, up to 200MB.
Do it with your command-line tool of choice; that may not look like much at first, but this is much more convenient when you’re spending your time in a terminal. No context-switching, and faster. Plus you get all the benefits of UNIX pipes.
Syntax highlight uploaded source files by appending a language extension to the file URI.
And, your files are securely stored on Amazon S3.
Here is what you type in your command line:
$ curl -u user:pass -T path/to/file https://chunk.io
Here is what you receive (as a text/uri-list
payload):
https://chunk.io/crohr/f1ec04b3586f415d9ae4cac7bbe64826
Simple heh? From now on we’ll no longer separate request and response, and
the username & password will be stored in the local .netrc
file, i.e. the
previous example will be written as:
$ curl -n -T path/to/file https://chunk.io
https://chunk.io/crohr/f1ec04b3586f415d9ae4cac7bbe64826
To silence the progression bar automatically added by cURL, just add the -s
flag:
$ curl -nsT path/to/file https://chunk.io
https://chunk.io/crohr/f1ec04b3586f415d9ae4cac7bbe64826
$ curl -nsT "{path/to/file1,path/to/file2}" https://chunk.io
https://chunk.io/f/1edae590c82d46deb930b4237828d809
https://chunk.io/f/6f564528446f1572482f8462cf544d05
One URL per line. No worries. You can even do:
$ curl -nsT "img[1-1000].png" https://chunk.io
https://chunk.io/f/1edae590c82d46deb930b4237828d809
https://chunk.io/f/6f564528446f1572482f8462cf544d05
...
We also accept multipart uploads. In this case, if you send multiple
files at once, they’ll be tar’ed up in a single .tar
file! Here is how
you would share multiple photos with your friends:
$ curl -n -FILE1=@path/to/file1.jpg -FILE2=@path/to/file2.jpg https://chunk.io
https://chunk.io/f/xxx
Then, you can either share the URL to the tar file, or access a single file within the archive:
$ curl https://chunk.io/f/xxx/file1.jpg
$ cat file1 file2 | curl -nsT - https://chunk.io
https://chunk.io/f/1edae590c82d46deb930b4237828d809
Basically you can use this to upload the output of any tool that outputs something on STDOUT.
Yes, that means cURL as well:
$ curl http://www.iana.org/domains/example/ | curl -nsT - https://chunk.io
https://chunk.io/f/005310aba7fd6d1ef3ff0223ca166b9c
Since Chunk.io now requires authentication, you can also remove any uploaded file:
$ curl -n -X DELETE https://chunk.io/crohr/f1ec04b3586f415d9ae4cac7bbe64826
If you’re on Mac OS, here’s how you send the content of your clipboard:
$ pbpaste | curl -nsT - chunk.io
https://chunk.io/f/1bb394a6596eb3a7b53ae2760c646b0d
And here’s how you copy the resulting link into your clipboard:
$ curl -nsT path/to/file https://chunk.io | pbcopy
$ pbpaste
https://chunk.io/f/1bb394a6596eb3a7b53ae2760c646b0d
See this article for an equivalent tool for Linux.
$ curl -ns https://chunk.io/USERNAME
# last_modified=2017-08-16T14:07:15.000Z size=8296034
https://chunk.io/crohr/1a47cbda7c2d4f5cadbf5d2d0e65f1c3
# last_modified=2017-08-19T14:18:00.000Z size=395
https://chunk.io/crohr/3701eec6fd1b410c8ea1f77ec7115f36
...
Pass the -s
flag to get silent output (no progression bar).
Pass the -i
flag to see the HTTP header of the response.
Pass the -n
flag to automatically send authentication credentials from your .netrc
file. E.g.
# ~/.netrc machine chunk.io login USERNAME password PASSWORD
Chunk.io is only available over SSL: https://chunk.io.
Add the lang
query parameter at the end of the URL to syntax highlight the
file. For instance for a nodejs source file:
For image files, just set the extension to png
, jpg
, etc. to get the
image displayed in a proper HTML page: https://chunk.io/crohr/f1ec04b3586f415d9ae4cac7bbe64826.jpg.
Remember the multi-file to .tar
example? You can easily navigate within any uploaded tar archived by appending the path of the directory you want to view (here the root path: /
).
E.g. https://chunk.io/crohr/d53e0f60109145f9b97accb5c3c9c0b0/.
Just append the name of the file you’d like to extract from the archive.
E.g. https://chunk.io/crohr/d53e0f60109145f9b97accb5c3c9c0b0/index.html.
See above: tar your static assets, upload to chunk, and access the index.html file!
Yes, but due to abuse you need to manually ask for access. Uploads are limited to 200MB, and may be deleted after 6 months.
This is a simple NodeJS daemon, packaged as a DEB/RPM package or Docker image that can be easily installed on your servers. Contact hello@chunk.io if you’d like to buy a copy.
Made by Cyril Rohr - Humming along since 2010.
Check out my other projects: