curl-and-php
PHP & Curl - Timeout
Date: Thu, 12 Jun 2003 15:59:00 +0200
Hello List,
im using this small php include file to Upload a XML File via HTTP Post upload
Versions:
php 4.0.6
curl 7.10.5
<?php
global $XMLURL;
global $fp;
global $zipfile;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$XMLURL); <- the path to the servlet to which
im posting my data
curl_setopt($ch, CURLOPT_POST, 1);
if ($DEBUG>0) curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_INFILESIZE,filesize($zipfile)); <- path to the
file I want to upload via POST
curl_setopt($ch, CURLOPT_FILE,$fp);
if ($DEBUG>0) $c=curl_setopt($ch, CURLOPT_NOPROGRESS, 1);
$formvars[handler]="insertion";
$formvars[version]="1.0.0";
$formvars[file]="@$zipfile";
$c=curl_setopt($ch, CURLOPT_POSTFIELDS, $formvars);
$reply=curl_exec ($ch);
curl_close ($ch);
?>
it works find for small files (the file includes an xml file + grafic
datas) and worked with around 2 MB
but if i try this with a bigger file [around 28 MB with 480 rows of data]
the execution seems to timeout
i looked at the servlet and saw that it still processes my file so i guess
its a Timeout problem with
the curl_exec() function !?!? i even tried curl_setopt($ch,
CURLOPT_TIMEOUT, 32000); with only the same
result.
php max_execution_time is set to 3000 which is around 50 min but the upload
ends after around 430 seconds
and the servlet [to which im sending the data is still in the middle of
processing the XML file] so my only
problem is that i dont get a response and therefor dont know if the upload
was successfully coz im missing the response
from the servlet .. :-( *sigh*
is there something else i should watch out !? Any other solutions which
might help in that case !?
thx for any comment!
Thomas
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Received on 2003-06-12