curl-users
Re: -F and config files
Date: Mon, 28 Jul 2003 10:25:47 +0200 (CEST)
On Mon, 28 Jul 2003, Howell, Andrew wrote:
> I am trying to use curl to upload to a HTTPS server with version
> 7.10.5 for win32. I need to use the -F option several times to specify a
> number of form fields. Unfortunately I end up with a command that is
> ~300bytes long and (lame) DOS truncates commands to 127bytes length..
Hehe. Crap. :-)
> I decided I could use -K <config file> to specify all my command line
> parameters to get around this limitation but I find that -F doesn't =seem=
> to work properly in a config file. As soon as I include a single -F in my
> config file, curl uploads something to the URL but receives nothing. If I do
> the equivalent with a command line switch then I receive stuff OK and it
> seems to work differently.
I'm sorry, but I cannot verify this problem. I just wrote up a test case for
exactly what you're suggesting and it certainly works fine for me.
> Can I use -F in a config file?
Yes. But as all other options in config files, you must only use one option
per line. Like in:
-F name=daniel
-F tool=curl
-F file=@log/test9.txt
> If I can't, is the best workaround to form all the headers myself in an
> ASCII file and use the -d option?
You can perform a multipart formpost with -d too, yes, if you are up to some
advanced fiddling, but you need to make sure all headers are made correctly
and that you have a proper Content-Type: header with the boundary string etc.
-- Daniel Stenberg -- curl: been grokking URLs since 1998 ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01Received on 2003-07-28