cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: How to do a HTTP-Post with "Content-Disposition: attachment; ..."?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 13 Mar 2007 22:49:14 +0100 (CET)

On Tue, 13 Mar 2007, Holger Härtling wrote:

> is it possible to perform a file upload via HTTP-Post and use
> "Content-Disposition: attachment" instead of "multipart/form-data"?

The question is oddly put.

When curl does a multipart formpost, it sends no header that is
"Content-Disposition: multipart/form-data" so no you can't replace any such
header.

curl sends "multipart/form-data" in the Content-Type: header, and it sends
"form-data" in the Content-Disposition: header within each form part.

While the Content-Type: header is possible to change, it doesn't make much
sense to do since the boundary string is in that header and that is not
possible to set, The Content-Disposition: within the form part is modifyable
to some extent, but you can't in fact change the "form-data" string.

Of course, you can make up your own post entirely and just use -d @filename.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-03-13