From 00cfff8194f87b493021c50ec5d97c3be5614bc4 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Fri, 3 Aug 2018 15:41:32 +1000 Subject: [PATCH] up: switch to multipart form for uploading, since guessing the content type locally with file often messes up --- local/bin/up | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/local/bin/up b/local/bin/up index e25c7f5..3272f7e 100755 --- a/local/bin/up +++ b/local/bin/up @@ -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