@mbavio I have these directories setup on my site, with a folder for each model.
webroot/files/uploads/ webroot/files/images/ webroot/files/videos/ I have a refresh() method in the FileBehaviour which looks at this directory and first goes through the filesystem comparing the filenames/filemtime to the database. Then I go the other way and select all from the database and makes sure all files in database still exist. I also use md5_file() to check if a file is the same as another, so I can detect if a file was renamed. Could be an expensive operation if you had thousands and thousands of files, but I only do this manually every so often, and I've only got maybe 500 files to check. @AD7six I've just found the code you mentioned - hadn't seen it before. My comment about other solutions was based on my research back in April, which was when I first developed this code. I looked through your sample app, and it looks a bit different in terms of where we are doing our operations. My model doesn't handle any part of the uploading or resizing, these are handled in components or just methods in my controllers. This also means if I wanted to generate a pdf report, I could then save it into my documents table just by sending it to the model directly. The reason why I haven't released the code is because functionality that many people would expect is not there. I have been slowly refining the code over time to suit my needs with each project, and am still trying to find a good balance that will work for all projects. I don't think my method fits into textbook MVC, but it's easy to work with and has fit perfectly into a few different projects. Using phpThumb has also been a life saver, as sometimes I needed to add filters or watermarks to the images based on certain conditions. Cheers, Adam On Nov 29, 5:14 am, AD7six <[EMAIL PROTECTED]> wrote: > On Nov 28, 1:08 pm, Adam Royle <[EMAIL PROTECTED]> wrote: > <snip> > > > One day I hope to release the code, but can't right now. > > You are a tease ;). > > How is what you just described different from the alternatives, is it > just the folder syncing logic? I ask primarily because the description > is virtually the same as the way the generic upload behavior works. > Right down to the sample application with dynamic resizing based on > the requested url etc. > > AD --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
