If you do the image in db first then you can do an easy optimization later and look really brilliant because it serves them so much faster ;) On the other hand it is easier to control access to images when they are not just sitting where apache can toss them on any old image site it wants.
On 6/6/07, peterhf <[EMAIL PROTECTED]> wrote: > > > Thank you both for your insite and opinions. They are greatly > appreciated. > > After struggling for a day with the image-in-the-database paradigm, > I'm going to try the image-in-the-directory paradigm! > > Regards, > > Peter - > > On Jun 6, 2:38 pm, AD7six <[EMAIL PROTECTED]> wrote: > > peterhf wrote: > > > I have been influenced by the argument given a sites such as > > >http://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/. There > > > is a logic to me, that having the image and the data surrounding the > > > image are in one place, not devided between two places which would > > > require attention to not allowing the two from becoming out of sync. > > > > > I am certainly open to opposing views as I am new to dealing with > > > large quantities of images. > > > > I'll chuck an opinion in :). > > > > Sticking large numbers of image files in a db is handy in that the > > data is all in one place, but awful from several other perspectives. > > Storing the file path/meta data in the db so you know where things are > > and you can treat them as an object (i.e. link a user to an image or > > whatever) makes sense; to me putting the image data in the db is just > > an overcomplex means of achieving an inefficient solution. Unless you > > have a very good reason to do so, and it would have to be a reason > > that serving image files (which are outside of the webroot) with php > > doesn't solve, it would be best avoided. > > > > disadvantages I can think of: > > > > 1) Php serving an image is slower than just letting apache doing it, > > and significantly more so if you have to get the image source from the > > db. > > 2) You add dependencies to the db (and php if appropriate) you > > otherwise don't have to serve images > > 3) php's image functions work only on files afaik > > 4) It's going to take up more space in a db than it would on the file > > system > > 5) A db field has a size limit per file, a file system doesn't > > > > I'm sure there are more. If anyone has one of those "very good > > reason"s I'm game to be enlightened ;). > > > > hth, > > > > AD > > > > > -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
