curl-and-php
Re: curl Upload: command line OK - libcurl/PHP problem!
Date: Fri, 02 Apr 2004 13:38:55 +0100
Daniel
Thanks for an amazingly prompt, and detailed, answer
Daniel Stenberg wrote:
> In curl lingo, we don't speak of "upload" when we do a POST. A POST is just a
> POST. Thus, you should not set the upload option. In your case, you do a
> multipart formpost. (The differentiation may not matter, but the PHP/CURL
> module has opted for a different approach to offer multipart support so PHP
> programmers can't compare with other languages when it comes to this.)
... multipart? -- see below.
As you saw in my code, I did use a CURLOPT_POST, and did not use
either CURLOPT_PUT or CURLOPT GET.
>>$result = curl_setopt($ch, CURLOPT_POSTFIELDS,
>>"file=test.PDF&submit=Send%20Now");
>
>
> While this is POST data, it is not multipart data like you provided with the
> command line tools.
I do not see how to get the effect of the command line that
worked! :-).
What do I need to do here to specify multipart data?
Thanks.
Harry
+-+-+-+-+.+-+-+-+-+.+-+-+-+-+.+-+-+-+-+.+-+-+-+-+.+-+-+-+-+.+-+-+-+-+.+-+-+-+-+-
http://www.eng.ox.ac.uk/people/Harry.Fearnley
Dept Engineering Science, Parks Rd, Oxford, OX1 3PJ, UK
Tel: +44 (0)1865 273928 -- Fax: +44 (0)1865 273010
Received on 2004-04-02