r/commandline • u/speckz • Sep 30 '14
Command-line and web file sharing - transfer.sh
https://transfer.sh/6
u/cpbills Sep 30 '14 edited Sep 30 '14
transfer.sh() {
file="$1"
filename="$2"
if [[ -z "$filename" ]]; then
filename="${file##*/}"
fi
curl --upload-file "$file" "http://transfer.sh/$filename"
}In case you don't wanna remember curl or type stuff out a bunch.
3
u/mcstafford Oct 01 '14
I suggest you use
localto declare your variables and https for privacy's sake... but I like the way you think.1
u/spidyfan21 Oct 01 '14
ELI5 How would I implement this?
1
u/cpbills Oct 03 '14
Add it to
~/.bashrcor another script that is sourced when you log in. Then runtransfer.sh foo baror simplytransfer.sh fooif you don't need to change the filename.1
5
u/thomasloven Sep 30 '14
Did anyone else notice that the example animation doesn't use the returned url to download the file?
2
u/apanzerj Oct 03 '14
Would be better if this was open sourced and I could just plop this bad boy on my own aws server. Then I wouldn't have to worry about the implications of WHAT I'm uploading or where it lives...
8
u/anirvan Sep 30 '14
Yes, but what's their file retention/deletion policy? I couldn't find any explanation on their home page.