cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Multipart/mixed from Config File

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 19 Mar 2010 14:15:26 +0100 (CET)

On Fri, 19 Mar 2010, Jan.Lacok_at_farrow.com wrote:

> Content-type: multipart/mixed; boundary=BOUNDARY<cr/lf>

You can't set your own boundary string with curl. If you NEED that, you must
instead generate the entire thing yourself and send it with -d. It should be
very rare though.

> Content-type: application/x-www-form-urlencoded<cr/lf>
> Content-length: 136<cr/lf>

curl won't use Content-length: for individual sub-parts.

> -H "Content-Type: multipart/mixed; boundary=BOUNDARY"

This doesn't really work. curl (libcurl actually) generates and uses its own
boundary whatever you try to tell it.

> This is what is in the file DATA1.TXT:
>
> Content-length: 136<cr/lf>

This won't work, as curl expects you to pass on data, not headers.

> 0044: Content-Length: 1211
> 005a: Content-Type: multipart/mixed; boundary=BOUNDARY; boundary=-----
> 009a: -----------------------814d8b8ab9f8

See? It got confused by your attempt to replace it. :-)

> 0000: ------------------------------814d8b8ab9f8
> 002c: Content-Disposition: form-data; name="Filename"
> 005d: Content-Type: application/x-www-form-urlencoded
> 008e:
> => Send data, 163 bytes (0xa3)
> 0000: Content-length: 136

And this passes "Content-length: 136" as part of the actual payload.

> How the content of the file DATA1.TXT need to send in order for server to
> see the AppVersion...?

I suggest you cut out the Content-length: line. I've never seen a server-side
receiver of multipart formposts require content-length for a subpart.

> Inappropriate disclosure, copying, distribution or other use of the contents
> of this electronic message is strictly prohibited.

Is replying to the mail considered "other use"? Is this strictly prohibited?
Man, those dislaimers are stupid and pointless. Whine on your managers for
polluting the world with such crap.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-03-19