[Cctools-cchost] Re: [Clipart] ccHost - how to add file types
Victor Stone
lists at fourstones.net
Mon Feb 13 07:14:07 PST 2006
Jon Phillips wrote:
> On Sun, 2006-02-12 at 21:19 +0100, Tobias Jakobs wrote:
>
>>Am Sonntag, den 12.02.2006, 09:35 -0800 schrieb Bryce Harrington:
>>
>>>I found where we add file types: It's in cchost/cclib/cc-getid3.php, in
>>>list of code elements like this:
>>>
>>>
>>> $file_formats['audio-aiff-aiff'] = array(
>>> 'name' => 'aif',
>>> 'description' => 'AIFF Audio',
>>> 'enabled' => true,
>>> 'mediatype' => 'audio',
>>> );
>>>
I don't know that adding file types to that file will "just work" -- I
think the list of types in that file represents types that getid3 knows
how to verify. If getid3 doesn't know about that file type it will fail
no matter what you put into that file. Unless you:
- extend getid3 itself; not a bad choice and good for the community to
give back. THEN you need to add the type to cc-getid3.php
OR
- write your own verifier, and chain it to the existing one:
//------------------------------------------------------------
global $CC_UPLOAD_VALIDATOR;
$old_validator = $CC_UPLOAD_VALIDATOR;
$CC_UPLOAD_VALIDATOR = new MyValidator();
......
class MyValidator {
function FileValidate(&$formatinfo)
{
global $old_validator;
if( /* I can validate */ )
{
return;
}
return $old_validator($formatinfo);
}
}
//------------------------------------------------------------
something like that.
VS
More information about the clipart
mailing list