cURL / Mailing Lists / curl-users / Single Mail

curl-users

Content-Disposition headers

From: Ed S. Peschko <esp5_at_pge.com>
Date: Sat, 10 Mar 2007 01:45:40 -0800

hey all,

I had a couple of questions;

I'm trying to use curl-7.16.1 to post/upload some forms to a website, and was running
into difficulties with a very picky server..

In short, I *think* the server is expecting a header that looks something like:

        Content-Disposition: form-data; name="PWFORM";

wheras CURL is providing:

        Content-Disposition: form-data; name="PWFORM"; filename="postit1"
        

So - first question, how do you disable the 'filename=' part of it? I tried:

        curl -F 'PWFORM=@/tmp/postit3;filename=/dev/null'

but that doesn't seem to work, nor does

        curl -F 'PWFORM=@/tmp/postit3;filename='

Also, it looks like the boundary is too long, and has too many '----' in it.
The form that works looks like:

        Content-Type: multipart/form-data; boundary=xYzZY

--xYzZY

although, truth be told, I could be hallucinating these points.

Anyways, these are the only differences in the curl send data (which doesn't work)
and the perl send data (which does..). Any tips on customizing the curl forms so
they exactly match the perl would be greatly appreciated..

Ed

(ps - why curl if perl works? because libwww perl's proxy support is shaky at best..)
Received on 2007-03-10