The Frayed Ends of Sanity
Posted on 1st June 2007
This goes back to what I posted yesterday, don't send users down broken paths. If there are constraints tell them!
However, there is also another issue with sites that upload photos like this. If you have a limit on the size of the photos, resize the image. It isn't hard. This is what Labyrinth does, so although your original image might be 1280x1024 and be over 1MB, it will get saved as something like 800x800 or perhaps 150x150 for thumbnails all automatically, without the user having to worry about it. Why make the user jump through hoops, when you can so easily add a feature like that yourself?
The problem here though looks like the XWiki (or at least this installation of it) uses the database as a file store. The Java exception errors are from JDBC finding the data too big to store. Why is an image (or any media file) ever stored in the database? I've come across this idea a few times before and have never understood the point. Use the filesystem of the OS to store files and databases to store your textual content. You aren't going to search the content of the data block in the database, or if you are then I seriously doubt you get any benefit over using tools dedicated to accessing and interrogating files at the OS level.
Maybe it just comes down to the fact that Java programmers seem to want to try and do everything themselves. I've come across this several times when I was forced to use Silverstream many moons ago, also written in Java, and seem to be a mantra of Java in that it's the only tool for the job, even if it isn't.
Comments
No Comments