cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Newlines in multipart/form-data post

From: Robert Marlow <bobstopper_at_bobturf.org>
Date: 23 Apr 2004 16:12:16 +0800

Hi Daniel

I was doing it the way I gave in my previous example - ie putting quotes
around the arg to -F like this:
$ curl -F "foo=bar
baz" $URL

But you could be right - I just ran a test script to see how sh handled
arguments with multiple lines and it does seem to do some funny things,
though in the case of my test it seemed to just remove the newlines and
concatenated them together. I'm not sure if that's somehow related to
the problem.

I did notice that taking the argument to -F directly from a file works
just fine (I might use that as a workaround for the time being), but I
imagine that uses quite different parsing mechanics. I haven't yet
looked in the source code deeply enough to be sure.

On Fri, 2004-04-23 at 14:18, Daniel Stenberg wrote:
> I have not been able to create a test case for this situation, no. I just
> removed the scan-to-newline code in the patch as I couldn't think of anything
> else that would stop at a newline (in curl).
>
> How do you trick your shell to send the newline in the arugment and not use it
> as a separator for the next argument?
>
> --
> Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
> Dedicated custom curl help for hire: http://haxx.se/curl.html
>

-- 
Regards,
Robert Marlow
Received on 2004-04-23