Error while trying to unzip audio contents in zipfile

Locked
joshilpa
User
Posts: 1
Joined: Thu Jan 31, 2013 12:44 am
Are you a spambot?: no

Error while trying to unzip audio contents in zipfile

Post by joshilpa » Thu Jan 31, 2013 12:55 am

Hi

I am Implementing Audio module in drupal and trying to extract Id3 tags from mp3 files uploaded in zip file. I could figure out extraction for single mp3file but I am trying to figure out how to parse mp3 files in zip file and extract Id3 tags. I have been following

/demo/demo.zip.php - part of getID3() //
// Sample script how to use getID3() to decompress zip files //

by

getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //


But I am getting following error as "Argument 1 passed to getid3_handler::__construct() must be an instance of getID3".

Can anyone please guide me as to how to overcome this and accomplish my task. It would be helpful if you can point me to any working file or sample code.

Thanks!

Regards
Shilpa.

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: Error while trying to unzip audio contents in zipfile

Post by James Heinrich » Thu Jan 31, 2013 2:09 pm

Could you post a snippet of your code?

The UnzipFileContents() function in demo.zip.php will return you uncompressed contents of the entire zip file in an array. Be aware this could blow up if you have any sizable zip file where the uncompressed size of the data is more than half your PHP-allocated memory. But use the example, walk through the zip file and write each file data to a temporary file, analyze with getID3 and then delete the temp file. If your server's PHP installation has zip support then you may also consider using the PHP zip functions, although it will make your code less portable (not all PHP installations support the zip extention).
http://www.php.net/manual/en/ref.zip.php

Locked