#!/bin/sh mode=$1 url=$2 file=$3 LIBDIR="@LIBDIR@" source "$LIBDIR/functions" USERAGENT="fb-client/shell-@VERSION@" CURLOPTS="-n -L -A $USERAGENT" if [ "$mode" = "u" ]; then basefilename=`basename -- "$file"` if [ `$STAT -- "$file"` -eq "0" ] || echo "$basefilename" | grep -F -q ","; then 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 else curl $CURLOPTS "$url" fi