File sharing tools are a dime a dozen these days. There’s Dropbox, Google Drive, and iCloud. But what if you want to share something quickly and easily from the command line? That’s why programmer Remco Verhoef created Transfer.sh.
The service has basically a file dump. You send a file to transfer.sh via curl and it stays there for fourteen days until its automatically deleted. For example, I uploaded this picture by adding a bit of code to my .bashrc.
The system is one of those small, clever tools that just works. Verhoef created it because he needed to be able to upload files on the fly.
“I created this application when I needed to share log data from within a ssh shell with someone else,” he said. “So I created a web application where I can easily upload files using curl (which is available on almost every platform) just using the command line and modify the file on the fly, like encrypting the contents, applying grep etc. The application has been made open source because it could be usable for many other people and I’d encourage them to run their own server.”
How to upload
# Uploading is easy using curl
$ curl --upload-file ./hello.txt https://transfer.sh/hello.txt
$ curl -H "Max-Downloads: 1" -H "Max-Days: 5" --upload-file ./hello.txt https://transfer.sh/hello.txt
# Download the file
$ curl https://transfer.sh/66nb8/hello.txt -o hello.txt
Upload multiple files at once
$ curl -i -F filedata=@/tmp/hello.txt -F filedata=@/tmp/hello2.txt https://transfer.sh/
# Combining downloads as zip or tar archive
$ curl https://transfer.sh/(15HKz/hello.txt,15HKz/hello.txt).tar.gz
$ curl https://transfer.sh/(15HKz/hello.txt,15HKz/hello.txt).zip
Encrypt your files before the transfer