Share files easily from cli with transfer.sh

storage
upload
cli
cloud
encrypted

#1

Hello everyone,

Let me present you transfer.sh which permit to upload files and share them from command line.

-Chromium_001

It has many advantages comparing to others cloud storage providers :

  • Could be self-hosted : https://github.com/dutchcoders/transfer.sh
  • Made for use shell (you can also upload files from their/your web interface)
  • Share files with URL
  • Upload up to 10Go
  • Files stored for 14 days
  • Files can be encrypted during upload
  • Free

Every settings can be modified if you host the service.

Few tips to use it :

Upload:
$ curl --upload-file ./hello.txt https://transfer.sh/hello.txt

Encrypt & upload:
$ cat /tmp/hello.txt|gpg -ac -o-|curl -X PUT --upload-file "-" https://transfer.sh/test.txt

Download & decrypt:
$ curl https://transfer.sh/1lDau/test.txt|gpg -o- > /tmp/hello.txt

Upload to virustotal:
$ curl -X PUT --upload-file nhgbhhj https://transfer.sh/test.txt/virustotal

Add alias to .bashrc or .zshrc (best method for me) :

transfer() {
    # write to output to tmpfile because of progress bar
    tmpfile=$( mktemp -t transferXXX )
    curl --progress-bar --upload-file $1 https://transfer.sh/$(basename $1) >> $tmpfile;
    cat $tmpfile;
    rm -f $tmpfile;
}

Alias transfer=transfer
$ transfer test.txt

Do you think it could be useful to integrate the alias into the QuickBox .bashrc file ? (as QuickBox commands).
It’s also possible to create a package app if you want to host it on your server to have your own cloud service :slight_smile: