From 139febd183efe61da763ea06e873460e0478cc69 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 25 Jan 2012 12:50:08 +0100 Subject: 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 --- fb-helper.sh.in | 4 ++-- 1 file 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 -- cgit v1.2.3-24-g4f1b