ThisFileInfo is empty!

The place for "I can't figure out how to..." questions.

ThisFileInfo is empty!

Postby diesel » Wed Jun 02, 2010 12:31 am

Hi!
Thanks for such a wonderful library.

Well my problem is I believe, using the adequate code, my array doesn't get filled with info.
I am passing to the analyze function the simplest filename like 'C:\1.mp3' to see if spaces or bad slashes were wrong and still the array is empty.

Basically my code is something like:
Code: Select all
...

if (!@include_once('../getid3/getid3.php')) {
   die('Cannot open '.realpath('../getid3/getid3.php'));
}

function getid3data($filename,$max1) {

$filename = realpath($filename);
if (is_file($filename)) {      

// OPTIONS:
$getid3_demo_mysql_encoding = 'ISO-8859-1';
$getid3_demo_mysql_md5_data = false;        // All data hashes are by far the slowest part of scanning
$getid3_demo_mysql_md5_file = false;

// Initialize getID3 engine
$getID3 = new getID3;
$getID3->setOption(array(
   'option_md5_data' => $getid3_demo_mysql_md5_data,
   'encoding'        => $getid3_demo_mysql_encoding,
));

//$filename = "C:\1.mp3";

         $ThisFileInfo = $getID3->analyze($filename);
         getid3_lib::CopyTagsToComments($ThisFileInfo);      
         
         $SQLquery  = 'INSERT INTO `files` (`iduser`, `filename`, `path`, `pathp`, `type`, `filesize`, `fileformat`, `ext`, `codec`, `bitrate`, `samplerate`, `depth`, `bitratemode`, `vbr_method`, `avg_bitrate`, `lossless`, `playtime`, `id3_artist`, `id3_title`, `id3_comment`, `id3_year`) VALUES (';
         
            //$SQLquery .= '"'.mysql_real_escape_string($SESSION['id']).'", ';
            $SQLquery .= '21'.', ';            
            $SQLquery .= '"'.mysql_real_escape_string(@$ThisFileInfo['filename']).'", ';
            $SQLquery .= '"'.mysql_real_escape_string(@$ThisFileInfo['filenamepath']).'", ';               
            $SQLquery .= '"'.mysql_real_escape_string($filenamep).'", ';
                                .....etc

....



And those values don't get informed.

Something curious was, uploading same code to server, in the server it would get ONLY the filesize and the path!!! (@$ThisFileInfo['filesize'] and @$ThisFileInfo['filenamepath'])
!!!

So I started wondering which differences could be between my localhost and my real server, and started to believe I might have to set up some php variables on servers.

Please, some light about this?

Thanks a lot!

Diesel
diesel
User
 
Posts: 1
Joined: Wed Jun 02, 2010 12:11 am

Return to Support 1.7.x

Who is online

Users browsing this forum: No registered users and 1 guest

cron