up: switch to multipart form for uploading, since guessing the content type locally with file often messes up

This commit is contained in:
Danielle McLean 2018-08-03 15:41:32 +10:00
parent 19b8f350cf
commit 00cfff8194
Signed by: 00dani
GPG key ID: 8EB789DDF3ABD240

View file

@ -1,12 +1,10 @@
#!/bin/zsh
upload() {
http --check-status --ignore-stdin \
http --check-status --ignore-stdin --form \
POST https://up.00dani.me/ \
Authorization:$UP_TOKEN \
Content-Type:$(file --mime-type -b $1) \
X-Filename:$1 \
@$1
file@$1
}
if (( $# == 0 )); then