summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2012-01-25 12:50:08 +0100
committerFlorian Pritz <bluewind@xinu.at>2012-01-25 12:50:08 +0100
commit139febd183efe61da763ea06e873460e0478cc69 (patch)
treeffb0a515e0eb2585b76241e4ddedbfee845b31af
parent3e32e2ce18fba5a52d2d1ddbaf34b6800f644f03 (diff)
fb-helper.sh: base64 encode the filename if there is a comma
The server will decode this and use it instead of the filename sent with the file itself. Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--fb-helper.sh.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/fb-helper.sh.in b/fb-helper.sh.in
index e6868f6..0c023fb 100644
--- a/fb-helper.sh.in
+++ b/fb-helper.sh.in
@@ -14,8 +14,8 @@ CURLOPTS="-n -L -A $USERAGENT"
if [ "$mode" = "u" ]; then
basefilename=`basename -- "$file"`
if [ `$STAT -- "$file"` -eq "0" ] || echo "$basefilename" | grep -F -q ","; then
- basefilename=`echo "$basefilename" | tr -d ,`
- curl $CURLOPTS -F "file=@-;filename=$basefilename" "$url" < "$file" -o /dev/stdout
+ base64fn=`echo "$basefilename" | base64 -w0 `
+ curl $CURLOPTS -F "file=@-" -F "filename=$base64fn" "$url" < "$file" -o /dev/stdout
else
curl $CURLOPTS -F "file=@$file" "$url" -o /dev/stdout
fi