I'm thinking of starting a new project but I'm unsure whether I should use Java. It's a web application that allows people to build a quiz and I want the user to be able to add questions and images. Can you upload images in Java? Can the program then make use of that image? I figured that because the image isn't already in the jar (and in the right directory) then it can't be used by the program.
I wondered whether I could store any images in a central database and access them this way? is this difficult? Having this data separate in a database might make it easier to produce Android and iphone apps if I went that far (I probably won't). I could write the application in PHP but then I'd lose some functionality.
Its your call to decide which technology you want to use to develop a application, most of the things are supported in most of the technologies.
“Anyone who has never made a mistake has never tried anything new.” ― Albert Einstein
Joined: Jun 28, 2009
Thanks for the input guys.
With the jars I have produced so far I can only access images that are in the current jar (ie already zipped up) or in the source directory of the jar. I presume you're saying a java app/applet can input an image and store it in it's home directory so that other users can use it? Can you point me at an example or a slightly longer explanation as to how to do this (or even some keywords I can google ). Cheers.
You can do what you are asking, but as @bear asks, are you sure you have thought out the architecture for this?
Concerning storing images on your server, you have many choices. You can simply store the images as files that your webserver (apache, etc.) can read, or you can store the bytes of the image in a blob in your favorite database table in a DBMS (mysql, sqllite, oracle, etc.). Which you select is simply an engineering design question, there are pros and cons of each.