cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: http post

From: Manuel Gavina <manuel.gavina_at_netc.pt>
Date: Thu, 21 Mar 2002 10:34:28 -0000

Hi;

This are the CURL options I used to post a binary file,

curl_easy_setopt(easyhandle, CURLOPT_POST,1);

/* post binary data */
curl_easy_setopt(easyhandle, CURLOPT_POSTFIELD, binaryptr);

 /* set the size of the postfields data */
curl_easy_setopt(easyhandle, CURLOPT_POSTFIELDSIZE, 23);

curl_easy_perform(easyhandle); /* post away! */

Regards.

    -----Original Message-----
    From: Ajit, Kumar (IE10) <ajit.kumar_at_honeywell.com>
    To: Manuel Gavina <manuel.gavina_at_netc.pt>
    Date: Quinta-feira, 21 de Março de 2002 4:22
    Subject: RE: http post
    
    
    dear manuel,
    i am using the curl library to post a binary file (*.tar.gz) file to my
    server. but, i have a problem...only few bytes of the file are getting
    stored in the server side eventhough I send the total file(by seeing how
    many times my callback method is called)...so, can you please write me what
    are the CURL options I need to use to post a binary file?
    thanks & regards
    ajit
    
> -----Original Message-----
> From: Daniel Stenberg [SMTP:daniel_at_haxx.se]
> Sent: Thursday, March 21, 2002 4:15 AM
> To: Manuel Gavina
> Cc: libcurl Mailing list
> Subject: Re: http post
>
> On Wed, 20 Mar 2002, Manuel Gavina wrote:
>
> > I'm using libcurl to do a http post, postting a binary file to a
> server
> > Apache running in Windows, with a cgi page. When I encode my file,
> because
> > of the special chacters the file takes mores bytes.
>
> Yes, that's quite natural.
>
> > When received the file is size is equal to is size when encoded and
> > before I do a post, what to I want to do so that my file size should be
> > equal to the original?
>
> Well, how do you receive the post? Why don't you decode the received data?
>
> > The error is in my cgi page or in any CURLOPT that I use?
>
> Since you encode the data before you send it, you must decode it when
> you've
> received it.
>
> Or am I misunderstanding something here?
>
> --
> Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
>
Received on 2002-03-21