And like magic - I've improved my version to include thumbnail generation. It uses Nate Constant's PHPThumb Generator Component (http://bakery.cakephp.org/articles/view/phpthumb-component).
http://bin.cakephp.org/view/367489026 You can overide your thumbnail size in the arrayt, the default is 100x100. The output is a file called thumb.(filename).(ext). Tane On 6/1/07, Tane Piper <[EMAIL PROTECTED]> wrote: > I finally got it to work as well. Here is my modification: > > http://bin.cakephp.org/view/367489026 > > This one takes the upload file name, and corrects is for "bad" > characters such as whitespace, & and + and replaces them with > friendlier versions. > > Please feel free to play about, and make better (i'm going to look at > adding the thumbnail stuff) > > Tane > > On 6/1/07, dardosordi <[EMAIL PROTECTED]> wrote: > > > > > By the way, I'm not sure about the placement of upload files as a > > > behavior. I see it on the controller layer, but not so sure :-(. > > > > Yeah, I've thought it too, but then put it this way: uploading a file > > is storing data, then is a model thing. And the behaviour was there > > (Thanks a lot Chris Partridge! ) and works pretty well. > > > > This is how I tweaked it: > > > > Tweaked Behaviour: http://bin.cakephp.org/saved/19658 > > > > Example: > > > > Model : http://bin.cakephp.org/saved/19659 > > > > Controller: http://bin.cakephp.org/saved/19660 > > > > View: http://bin.cakephp.org/saved/19661 > > > > Hope it helps. > > > > Also I use this amazing helper: > > http://bakery.cakephp.org/articles/view/image-resize-helper > > and put some code in the behaviour to delete cached thumbs when the > > record is deleted. > > > > It's all there, just read the code. > > > > > > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
