cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problem in posting filename=""

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 11 Dec 2008 10:26:13 -0800

On Thu, Dec 11, 2008 at 06:30:12PM +0530, rakesh.sharma2_at_wipro.com wrote:
> My problem is that I have to post the Form-data as exactly same as i got
> from Live HTTP Header output.
> This is Live HTTP header output:
>
> Content-Disposition: form-data; name="name:_id11"; filename=""
> Content-Type: application/octet-stream
>
>
> -----------------------------1496212324596
> Can anyone sugget me how to do this with curl_formadd( )
>
> I am trying something like :
>
> curl_formadd(&formpost,&lastptr,
>
> CURLFORM_COPYNAME, "name:_id11",CURLFORM_COPYCONTENTS,"",
>
> CURLFORM_FILENAME,"filename",CURLFORM_COPYCONTENTS,"",
>
> CURLFORM_END);
>
> But not able to form the exact form data.

Well, what does that give you?

I'm able to replicate the output above with the curl command:

curl -F 'name:_idll=@/dev/null;type=application/octet-stream;filename=' \
  http://example.com/

You can look at formparse() in src/main.c to see how that builds the form.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-12-11