Merci à vous ;-)
Malheuresement Anthomicro mon hebergeur n'est pas encore passé à php 5 :-\ Pour quiaimeflash c biewn ca! Mais a marche po :\ lol
J'ai essayé.
function remote_file_size($url){
$firstCut = substr($url, 7, strlen($url));
$firstSlashPOS = strpos($firstCut, "/");
$host = substr($firstCut, 0, $firstSlashPOS);
$filename = substr($firstCut, $firstSlashPOS, strlen($firstCut));
$fp = fsockopen ($host, 80);
fputs ($fp, "GET $filename HTTP/1.1\r\nHost:
jboy.dyn.dhs.org\r\n\r\n");
for($i=0; $i < 10; $i++) {
$buffer .= fgets ($fp, 2000);
}
if(strstr($buffer, "Content-Type")) {
fputs ($fp, "\r\n\r\n\r\n");
fclose ($fp);
}
$contentLengthPOS = strpos($buffer, "Content-Length");
$buffer = substr($buffer, $contentLengthPOS+16);
$newLinePOS = strpos($buffer, "\n");
$buffer = substr($buffer, 0, $newLinePOS);
$answer = sprintf("%".strpos($buffer, ".").".1f", $buffer/1024);
if($answer > 1024) {
$answer = sprintf("%".strpos($answer, ".").".1fmb",
$answer/1024);
} else {
$answer .= "kb";
}
$formatAnswer = str_replace(' ','',$answer);
return $formatAnswer;
}
echo remote_file_size("http://teamfod.free.fr/vid/Diablus.com_36.avi");
Mais rien à faire :\ il m'affiche 0.0kb
----------------------------------------------------
Site en developpement :
www.diablus.com