I am trying to analyze a temporary uploaded file. File is uploaded via POST and kept in the default php upload directory. realpath = "C:\Program Files\PHP\upload\php167C.tmp" as an example. When I upload the file and try to get getid3 to analyze it I receive the following error...
Fatal Error: (8): Undefined index: ape in <B>C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\_dev\mraintranet\classes\getid3\module.tag.apetag.php</B> on line <B>68</B>
Using: PHP 5.2.1, Apache 2.2.3, GetID3() v2.0.0b4
Here is the code I am currently using...
- Code: Select all
require_once('classes/getid3/getid3.php');
foreach ($_FILES['trackdata']['name'] as $k => $v) {
if ($_FILES['trackdata']['tmp_name'][$k] != NULL) {
if (substr($_FILES['trackdata']['type'][$k],0,5) == "audio") {
if (!$file = fopen($_FILES['trackdata']['tmp_name'][$k],"rb")) {
Step1("There was an error while opening '".$v."'.");
}
$real = realpath($_FILES['trackdata']['tmp_name'][$k]);
//Step3($real); <- output example: C:\Program Files\PHP\upload\php167C.tmp
$getid3 = new getID3;
$getid3->encoding = 'UTF-8';
try {
$getid3->Analyze($real);
} catch (Exception $e) {
Step3($e->message);
}
Step3("OK");
}
}
}
If anyone has any ideas why I receive the above error and can help, the assistance would be greatly appreciated. On a similar note, before uploading the file and trying to build this script I placed the test.aiff file I am using into the getid3 demo directory and successfully analyzed it using the demo scripts. I hope there is enough information there ;)
