cURL / Mailing Lists / curl-users / Single Mail

curl-users

Posting the content of a file on Windows

From: Laurent <laurent1979_at_gmail.com>
Date: Wed, 21 Feb 2007 10:39:16 +0000

Hello,

I'm trying to post some data to a website using a Windows version of
curl. What I have to send can potentially be quite big (it's a base64
encoded audio file sent as a string). I tried with this:

curl -d "user=xxxx" -d "aud=base64encodedata" http://www.url.com

which works fine as long as the audio data is very small. If I try
with a file of say 10KB I get this error: "The input line is too
long."

Now I tried to get curl to read the data from a file and send it as a
string. From the manual I understand the syntax should be:

curl -d "user=xxxx" -d "aud=<myEncodedFile.b64" http://www.url.com

however I get this error: "Invalid character in a Base-64 string."

I also tried different alternatives such as:

curl -d "user=xxxx" -d "aud=@myEncodedFile.b64" http://www.url.com

curl -F "user=xxxx" -F "aud=<myEncodedFile.b64" http://www.url.com

curl -F "user=xxxx" -F "aud=@myEncodedFile.b64" http://www.url.com

but none of them worked. Any idea on what I might be doing wrong? Any
help would be very much appreciated!

Thanks,

Laurent
Received on 2007-02-21