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:
commit
464fc37d68
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user