curl-and-php
curl, read how much data was downloaded when aborted ?
Date: Tue, 15 Apr 2008 22:15:08 +0200
Hi,
I have got some problem with curl when I tried to download file from remote
host and send it to the browser.
I would like to read how much bytes downloaded by curl and how much bytes
was send to the browser even when browser (or user) aborted downloading.
I was try use this some code:
$url="http://somewhere.com/file.tar";
$ch = curl_init();
$g=basename($url);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
$mm_type="application/octet-stream";
header("Cache-Control: public, must-revalidate");
header("Pragma: hack");
header("Content-Type: " . $mm_type);
header("Content-Length: " .$size );
header('Content-Disposition: attachment; filename="'.$g.'"');
header("Content-Transfer-Encoding: binary\n");
curl_exec($ch);
$arrOut = curl_getinfo( $ch, CURLINFO_SIZE_DOWNLOAD );
curl_close($ch);
and it works when user download file at all. Won't work when user abort
downloading.
Hm - how can I read how much data was downladed when user abort downloading
?
-- K _______________________________________________ http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-phpReceived on 2008-04-15