1
0
mirror of https://github.com/dutchcoders/transfer.sh.git synced 2020-11-18 19:53:40 -08:00

Merge pull request #227 from sente/master

Fix the bash functions to handle files with spaces
This commit is contained in:
Andrea Spacca 2019-05-15 19:29:11 +02:00 committed by GitHub
commit 464fc37d68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,7 +63,8 @@ X-Url-Delete: https://transfer.sh/hello.txt/BAYh0/hello.txt/PDw0NHPcqU
### Using curl ### Using curl
```bash ```bash
transfer() { transfer() {
curl --progress-bar --upload-file "$1" https://transfer.sh/$(basename $1) | tee /dev/null; curl --progress-bar --upload-file "$1" https://transfer.sh/$(basename "$1") | tee /dev/null;
echo
} }
alias transfer=transfer alias transfer=transfer
@ -72,7 +73,8 @@ alias transfer=transfer
### Using wget ### Using wget
```bash ```bash
transfer() { transfer() {
wget -t 1 -qO - --method=PUT --body-file="$1" --header="Content-Type: $(file -b --mime-type $1)" https://transfer.sh/$(basename $1); wget -t 1 -qO - --method=PUT --body-file="$1" --header="Content-Type: $(file -b --mime-type "$1")" https://transfer.sh/$(basename "$1");
echo
} }
alias transfer=transfer alias transfer=transfer