# 使用 cURL 上传
$ curl --upload-file ./hello.txt http://f.odata.cc/hello.txt
http://f.odata.cc/Q0jTvIuXp7/hello.txt
# 使用 Shell 函数上传
$ transfer hello.txt
##################################################### 100.0%
http://f.odata.cc/hsVBUXdfIQ/hello.txt
# 使用 cURL 上传文件
$ curl --upload-file ./hello.txt http://f.odata.cc/hello.txt
http://f.odata.cc/Q0jTvIuXp7/hello.txt
$ curl -H "Max-Downloads: 1" -H "Max-Days: 5" --upload-file ./hello.txt http://f.odata.cc/hello.txt
http://f.odata.cc/Q0jTvIuXp7/hello.txt
# 下载文件
$ curl http://f.odata.cc/Q0jTvIuXp7/hello.txt -o hello.txt
# 将以下内容添加到 .bashrc 或 .zshrc
transfer(){ if [ $# -eq 0 ];then echo "没有指定参数。\n用法:\n transfer \n ... | transfer " >&2;return 1;fi;if tty -s;then file="$1";file_name=$(basename "$file");if [ ! -e "$file" ];then echo "$file: 没有此文件或目录" >&2;return 1;fi;if [ -d "$file" ];then file_name="$file_name.zip" ,;(cd "$file"&&zip -r -q - .)|curl --progress-bar --upload-file "-" "http://f.odata.cc/$file_name"|tee /dev/null,;else cat "$file"|curl --progress-bar --upload-file "-" "http://f.odata.cc/$file_name"|tee /dev/null;fi;else file_name=$1;curl --progress-bar --upload-file "-" "http://f.odata.cc/$file_name"|tee /dev/null;fi;}
# 现在可以使用 transfer 函数
$ transfer hello.txt
$ curl -i -F filedata=@/tmp/hello.txt -F filedata=@/tmp/hello2.txt http://f.odata.cc/
# 合并下载为 zip 或 tar 压缩包
$ curl http://f.odata.cc/(Q0jTvIuXp7/hello.txt,hsVBUXdfIQ/world.txt).tar.gz
$ curl http://f.odata.cc/(Q0jTvIuXp7/hello.txt,hsVBUXdfIQ/world.txt).zip
# 使用 gpg 加密文件
$ cat /tmp/hello.txt|gpg -ac -o-|curl -X PUT --upload-file "-" http://f.odata.cc/test.txt
# 下载并解密
$ curl http://f.odata.cc/Q0jTvIuXp7/test.txt|gpg -o- > /tmp/hello.txt
# 使用 Clamav 扫描恶意软件
$ wget http://www.eicar.org/download/eicar.com
$ curl -X PUT --upload-file ./eicar.com http://f.odata.cc/eicar.com/scan
# 上传恶意软件到 VirusTotal 获取永久链接
$ curl -X PUT --upload-file nhgbhhj http://f.odata.cc/test.txt/virustotal
# 备份,加密并上传
$ mysqldump --all-databases|gzip|gpg -ac -o-|curl -X PUT --upload-file "-" http://f.odata.cc/test.txt