On 13-jul-2007, at 12:47, Gorka wrote:

>
>> Or maybe even 'MiUploadBehavior extends UploadBehavior', and a  
>> call to
>> beforeSave{mime}{Type} is made if the method exists etc..
>
> Though this might enforce convention over configuration approach, I
> see two possible issues with it. First, some file types have several
> mime types -or better, mime names- they can fit ('image/jpg', 'image/
> jpeg' for example). On the other hand, you might want different
> treatments applied for files of the same type, say extract and record
> on DB the text from this PDF, but just zip and store the other one.
>
> When defining validation rules, we can define custom functions or use
> the ones implemented in Cake by setting the validation config array.
> Maybe we could use something similar to that?
>

Mimetype based super classes would indeed be a bit troublesome i  
think. I like the ImageUploadBehavior extends UploadBehavior idea a  
lot! You could still configure what constitutes an image or a  
document in the UploadBehaviour based on mimetypes and maybe even set  
some default methods to call. Then if you could override a default  
method of, for instance, extractText with convertToPdf in the  
controller you would have a very powerful set of functionality.

Tijs

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to