cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: How to send a form field value that begins with '@'?

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Fri, 4 Mar 2005 11:29:13 +0100 (CET)

On Fri, 4 Mar 2005, david houlder wrote:

>> > curl --form-string name=@string http://somewhere.org
>> > curl --form-file name=filename http://somewhere.org
>
>
> Yep, sounds ideal, now that I have RTFM properly. Presumably --form-file
> would trigger the multipart/form-data upload just like --form name=@file
> does?

Yes, I like this suggestion too and I'd expect "--form-file name=filename" to
equal "--form name=@file" and "--form-string name=string" to equal
"--form-string name=string". They would just fix the @-issue.

Anyone up to writing a patch for this?

> Note that there might be cases where you want to upload from a file but keep
> it as application/x-www-form-urlencoded (e.g. tiny files), so maybe there
> could also be another option, maybe --form-file-urlencoded. Not a priority
> in my book though.

No, that's an entirely different kind of form post and that is made with
-d/--data. There's just no "x-www-form-urlencoded" type with --form posts
unless you explicitly force the content-type to be that (which would be
nothing but odd).

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2005-03-04