Hi,
I am trying to read the output from an php script and write it to a static file. In the fread function under filesize I put 10241024100, but it still cuts off the read prematurely at around 8300 bytes. How can I solve this problem?
Thanks.
function publishFile($url = "http://www.myurl.com", $sourcepage, $tempfilename, $targetfilename){
$dynamic_source = fopen($sourcepage, 'r');
if (!$dynamic_source) {
// echo "<strong>Unable to load $sourcepage - Static page! Update Failed!</strong>";
exit();
}
$htmldata = fread($dynamic_source, 10241024100); // was 1024*1024 but files were getting cut off
fclose($dynamic_source);
$tempfile = fopen($tempfilename, 'w');
if (!$tempfile) {
// echo"<strong>Unable to open temporary file $tempfilename for writing! Static page update aborted!</strong>";
exit();
}
fwrite($tempfile, $htmldata);
fclose($tempfile);