Upload files from your terminal

$ curl -T path/to/file chunk.io
http://chunk.io/f/1edae590c82d46deb930b4237828d809

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.

Why ?

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:

And, your files are securely stored on Amazon S3.

Command-line usage

Transfer a single file from your filesystem

Here is what you type in your command line:

$ curl -T path/to/file chunk.io

Here is what you receive (as a text/uri-list payload):

http://chunk.io/f/1edae590c82d46deb930b4237828d809

Simple heh? From now on we’ll no longer separate request and response, i.e. the previous example will be written as:

$ curl -T path/to/file chunk.io
http://chunk.io/f/1edae590c82d46deb930b4237828d809

To silence the progression bar automatically added by cURL, just add the -s flag:

$ curl -sT path/to/file chunk.io
http://chunk.io/f/1edae590c82d46deb930b4237828d809

Upload multiple files from your filesystem

$ curl -T "{path/to/file1,path/to/file2}" chunk.io
http://chunk.io/f/1edae590c82d46deb930b4237828d809
http://chunk.io/f/6f564528446f1572482f8462cf544d05

One URL per line. No worries. You can even do:

$ curl -T "img[1-1000].png" chunk.io
http://chunk.io/f/1edae590c82d46deb930b4237828d809
http://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 -FILE1=@path/to/file1.jpg -FILE2=@path/to/file2.jpg chunk.io
http://chunk.io/f/xxx

Then, you can either share the URL to the tar file, or access a single file within the archive:

$ curl http://chunk.io/f/xxx/file1.jpg

Pipe some content into chunk.io

$ cat file1 file2 | curl -T - chunk.io
http://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 -T - chunk.io
http://chunk.io/f/005310aba7fd6d1ef3ff0223ca166b9c

Clipboard integration

If you’re on Mac OS, here’s how you send the content of your clipboard:

$ pbpaste | curl -T - chunk.io
http://chunk.io/f/1bb394a6596eb3a7b53ae2760c646b0d

And here’s how you copy the resulting link into your clipboard:

$ curl -T path/to/file chunk.io | pbcopy
$ pbpaste
http://chunk.io/f/1bb394a6596eb3a7b53ae2760c646b0d

See this article for an equivalent tool for Linux.

Tips

Be awesome

You’ve just uploaded a Ruby script? What about getting it syntax highlighted by appending a rb lang parameter to the end of the URL? Try http://chunk.io/f/f43a0651d53f46318db4c859311f5632?lang=rb for an example. This works with all extensions supported by the Pygments library. You can also highlight specific lines of the file by putting a reference after the hash tag in the URL: http://chunk.io/f/f43a0651d53f46318db4c859311f5632?lang=rb#43-58.

For image files, just set the lang to png, jpg, etc. to get the image displayed in a proper HTML page: http://chunk.io/f/21e058de49c04431b66b148576662d9d?lang=jpg. More options to come.

Remember the multi-file to .tar example? Try to append ?lang=tar or ?lang=archive you’ll get a nice page displaying the files in the archive!

Stream content (beta)

Ever wanted to share a log file with colleagues over HTTP? With real-time updates when new content appear? Then you should try the new streaming feature!

In a first terminal (producer), create a new stream, and send content to it

$ URL=$(curl -X POST stream.chunk.io/streams)
$ echo $URL # for reference
$ tail -f /var/log/nginx/access.log | curl -T - $URL

In another terminal (listener), access the URL and see live logs across the internet!

$ curl $URL

Terminating the producer will also terminate the connection on the listener(s).

Enjoy!

Is it free?

Yes. Anonymous uploads are limited to 50MB, and may be deleted after 6 months. Register if you want your files to be available forever. Registered accounts can upload and share files up to 5GB in size.