Commit 936a0896 authored by David Dollar's avatar David Dollar

support mime types for uploads

parent 29fa148f
...@@ -138,6 +138,9 @@ s3_curl() { ...@@ -138,6 +138,9 @@ s3_curl() {
arg="-T" inout="${4}" arg="-T" inout="${4}"
headers[${#headers[@]}]="x-amz-acl: public-read" headers[${#headers[@]}]="x-amz-acl: public-read"
headers[${#headers[@]}]="Expect: 100-continue" headers[${#headers[@]}]="Expect: 100-continue"
if [ "$mime" != "" ]; then
headers[${#headers[@]}]="Content-Type: $mime"
fi
else else
die "Cannot write non-existing file ${4}" die "Cannot write non-existing file ${4}"
fi fi
...@@ -162,7 +165,8 @@ s3_put() { ...@@ -162,7 +165,8 @@ s3_put() {
# $1 = remote bucket to put it into # $1 = remote bucket to put it into
# $2 = remote name to put # $2 = remote name to put
# $3 = file to put. This must be present if $2 is. # $3 = file to put. This must be present if $2 is.
s3_curl PUT "${1}" "${2}" "${3:-${2}}" # $4 = mime type
s3_curl PUT "${1}" "${2}" "${3:-${2}}" "${4}"
return $? return $?
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment