Lazy loaded image
transfer.sh - Easy and fast file sharing from the command-line.
00 min
Oct 4, 2023
Oct 8, 2023
type
status
date
summary
tags
category
URL
password
slug
icon
# Upload using cURL $ curl --upload-file ./hello.txt https://transfer.sh/hello.txt https://transfer.sh/PdmKSGCWsD/hello.txt # Using the shell function $ transfer hello.txt ##################################################### 100.0% https://transfer.sh/znu8gBXEGh/hello.txt
# Upload from web Drag your files here, or click to browse.

Made for use with shell

Share files with a URL

Upload up to 10 GB

Files stored for 14 days

For free

Encrypt your files

Maximize amount of downloads

Preview your files in the browser!

Sample use cases

How to upload

# Uploading is easy using curl $ curl --upload-file ./hello.txt https://transfer.sh/hello.txt https://transfer.sh/PdmKSGCWsD/hello.txt $ curl -H "Max-Downloads: 1" -H "Max-Days: 5" --upload-file ./hello.txt https://transfer.sh/hello.txt https://transfer.sh/PdmKSGCWsD/hello.txt # Download the file $ curl https://transfer.sh/PdmKSGCWsD/hello.txt -o hello.txt

Add shell function to .bashrc or .zshrc

# Add this to .bashrc or .zshrc or its equivalent transfer(){ if [ $# -eq 0 ];then echo "No arguments specified.\nUsage:\n transfer <file|directory>\n ... | transfer <file_name>">&2;return 1;fi;if tty -s;then file="$1";file_name=$(basename "$file");if [ ! -e "$file" ];then echo "$file: No such file or directory">&2;return 1;fi;if [ -d "$file" ];then file_name="$file_name.zip" ,;(cd "$file"&&zip -r -q - .)|curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null,;else cat "$file"|curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null;fi;else file_name=$1;curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null;fi;} # Now you can use transfer function $ transfer hello.txt
More examples

Follow on GitHub

Share the love

Any questions?

上一篇
What are the design principles for security?
下一篇
无惧 DDOS,无需开放额外端口,无需服务器,随时随地访问局域网 Web 应用 ——Cloudflare Tunnel | 我不是咕咕鸽