cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Problem: posting a file upload to a https server

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 22 May 2002 13:48:07 +0200 (MET DST)

On Fri, 17 May 2002, Keith Hui wrote:

( PHP 4.1.2, curl 7.9.7 (same problem with 7.9.6 too), openssl 0.9.6b.)

[multipart formpost code cut off]

> My program would run to curl_exec() and not return from it.

...

> By enabling various debugging options in the PHP curl module I knew that
> the curl request is executed correctly (and the server returned the
> expected response). When I checked with the server myself, the changes
> written in $batchfile is executed.

I'm not sure i understand this. Does the entire formpost get sent?

> If I set RETURNTRANSFER to 0, I'll see the server's entire response.

So the response is received too... Then it seems to be related to the
RETURNTRANSFER code. That particular code is in the PHP/CURL module - the PHP
glue layer for libcurl.

> I have tried everything on the book, for both PHP and curl, and still
> cannot get it to recognize that the one and only response the server will
> send has been sent, and return with it.

Can you perform the formpost upload with the command line tool properly?

> Do I have to tell curl to make a custom request to make this work?

You shouldn't need that. Then the PHP/CURL's support for multipart formposts
are a bit odd compared to how other bindings do that.

I am not a PHP hacker.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
Received on 2002-05-22