cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: -d and -F

From: Torsten Foertsch <torsten.foertsch_at_gmx.net>
Date: Tue, 8 Jul 2003 14:10:53 +0200

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

To upload a file you have to use multipart/form-data encoding. With -d your
data is sent application/x-www-form-urlencoded, with -F as required as
multipart/form-data.

Thus, your command line should be

curl -F "photo=@1.gif;type=image/gif" -F adv_id= -F MAX_FILE_SIZE=1000000 ...

Alternatively you can try whether your server does understand a mix of GET and
POST parameters:

curl -F "photo=@1.gif;type=image/gif" "http://...?adv_id=&MAX_FILE_SIZE=10..."

Torsten

On Tuesday 08 July 2003 13:04, Brano wrote:
> Hi curl-users_at_lists.sourceforge.net,
>
> I want fill in form, and also upload picture at the same time, but I
> dont know how to do it:
>
> curl -F "photo=@1.gif;type=image/gif" -d
> "adv_id=&MAX_FILE_SIZE=1000000&firm=VSetko&email=vsetko_at_hotmail.com&subsect
>ion=59&location=1&want_to=100&validity=1&text=text inzeratu" "http://..."
>
> doesn't work (You can only select one HTTP request!)
>
> exist some better way to do that, or I have to:
>
> curl -F "photo=@1.gif;type=image/gif" -F "adv_id=" -F
> "MAX_FILE_SIZE=1000000" ... ?
>
>
>
> -------------------------------------------------------
> 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/psa00100006ave/direct;at.asp_061203_01/01
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE/CrTQwicyCTir8T4RAl7OAKCJZxdsulaNwOT5RNp7CygHWIRsEgCfcQLU
1+6vTdOpi3cOYYjAC/iuMiA=
=oRpe
-----END PGP SIGNATURE-----

-------------------------------------------------------
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/psa00100006ave/direct;at.asp_061203_01/01
Received on 2003-07-08