r/commandline • • Sep 30 '14

Command-line and web file sharing - transfer.sh

https://transfer.sh/
41 Upvotes

10 comments sorted by

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.

4

u/thomasloven Sep 30 '14

Second paragraph: "We'll return a shareable url, which will expire within 2 weeks."

3

u/12sofa Sep 30 '14

Technically, that means the URL won't work after 2 weeks, but the data could still be available on their servers somehow. But if you're concerned about that kind of stuff, you shouldn't trust them anyway. They even provide commands for GPG encryption, so who cares.

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 local to 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 ~/.bashrc or another script that is sourced when you log in. Then run transfer.sh foo bar or simply transfer.sh foo if you don't need to change the filename.

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...