cURL / Mailing Lists / curl-users / Single Mail

curl-users

Saving binary data

From: Jerry Geis <geisj_at_pagestation.com>
Date: Wed, 15 Jan 2014 10:06:18 -0500

I am using curl with --data-binary to transfer a data file.

On the server side I have this:
       # Read in all DATA from stdin
        if [ "$REQUEST_METHOD" = "POST" ]
        then
                if [ "$CONTENT_LENGTH" -gt 0 ]
                then
                        Logging "$MACHINE" "$REFERENCE" "Received total
$CONTENT_LENGTH"
                        read -N $CONTENT_LENGTH POST_DATA <&0
                fi
        fi

echo -nE "$POST_DATA" > $TMP_FILE

However my binary data that I sent does not match.
SOMETHING in my saving of the data (POST_DATA) is
modifying the data. There is a backslash in the data and that
seems to be messing things up. The echo above with a backslash
I think is the problem.

How do I just "save" the data as is in a bash CGI script?

Thanks,

jerry

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-01-15