Remote file size, bit rate not return plz help

Locked
rinku999yadav
User
Posts: 1
Joined: Thu Feb 28, 2013 12:29 pm
Are you a spambot?: no

Remote file size, bit rate not return plz help

Post by rinku999yadav » Thu Feb 28, 2013 1:00 pm

i am using this code --

Code: Select all

<?php
require_once('../getid3/getid3.php');
$remotefilename = 'http://www.schillmania.com/projects/soundmanager2/demo/_mp3/click-high.mp3';
if ($fp_remote = fopen($remotefilename, 'rb')) {
    $localtempfilename = tempnam('/tmp', 'getID3');
    if ($fp_local = fopen($localtempfilename, 'wb')) {
        while ($buffer = fread($fp_remote, 8192)) {
            fwrite($fp_local, $buffer);
        }
        fclose($fp_local);

		// Initialize getID3 engine
		$getID3 = new getID3;

		$ThisFileInfo = $getID3->analyze($filename);
echo 'FileSize: '.$ThisFileInfo['filesize'];
        // Delete temporary file
        unlink($localtempfilename);
    }
    fclose($fp_remote);
}
?>
But i am getting only a Keyword -- FileSize:
I want to get the size of this audio ?
You can test it here http://mp3yoyo.com/getid/demos/demo.http.php
demo.browse.php working file.

James Heinrich
getID3() v1 developer
Posts: 1457
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: Remote file size, bit rate not return plz help

Post by James Heinrich » Thu Feb 28, 2013 1:40 pm

Replace your call to

Code: Select all

echo 'FileSize: '.$ThisFileInfo['filesize'];
with

Code: Select all

echo '<pre>'.print_r($ThisFileInfo, true).'</pre>';
and you'll see what is actually being returned. Pay particular attention to whatever is returned in [error] and [warning].

Locked