}
curl_close($oChandle);
if($bWriteFile) fclose($oFilePtr);
return($sRetVal);
}
-Original Message-
From: Robert Cummings [mailto:rob...@interjinn.com]
Sent: Thursday, October 22, 2009 11:21
To: Marshall Burns
Cc: php-general@lists.php.net
Subject: Re: [
Hi Marshall,
the function file_get_contents may have problem with large files.
You could try get the file using "fread" and feof.
Here i put a example
$contents = '';
while(!feof($stream)){
$contents .= fread($stream, 8192);
}
Gerardo Benitez.
On Thu, Oct 22, 2009 at 12:38 PM, Mars
Marshall Burns wrote:
Robert and others,
I made that change in the code. It still does not trap the failure. I
believe the reason is that the script is timing out while
file_get_contents() is sitting there waiting for input. The problem is that
the function never returns, so there is no return v
mp;m=125622597723923&w=2 .
Thanks.
-Original Message-
From: Robert Cummings [mailto:rob...@interjinn.com]
Sent: Thursday, October 22, 2009 08:44
To: Marshall Burns
Cc: php-general@lists.php.net
Subject: Re: [PHP] Trapping failure of file_get_contents()
Marshall Burns wrote:
> I have a
Robert Cummings wrote:
>
> Marshall Burns wrote:
>> I have a script that downloads a sequence of files online. Every hundred
>> files or so, it fails with:
>
> Check for the return value being equal to false:
>
>
> if( ($sFil = file_get_contents( $sURL )) === false )
> {
> // F
Marshall Burns wrote:
I have a script that downloads a sequence of files online. Every hundred
files or so, it fails with:
Check for the return value being equal to false:
Make sure you use the triple '=' comparison operator since you need to
check against the type being boolean also.
Ch
I have a script that downloads a sequence of files online. Every hundred
files or so, it fails with:
==
Warning: file_get_contents() []: failed to open stream: A connection
attempt failed because the connected party did not properly respond after a
period of time, or es
7 matches
Mail list logo