KrisM82
asked on
Uploading images & Image manipulation
Hi everyone
What I am trying to do is this:
I want to have a JSP where the user browses for an image, and then clicks a submit button, I then want the selected image to be uploaded and stored...
My questions are:
1 - Can the image be stored in a MySQL database or does it have to be uploaded to a directory
2 - Is there a way to manipulate the image and make thumbnails etc in a Servlet?
3 - Is there a java API for doing things like this (if yes any chance of a url)?
Many thanks
Kris
What I am trying to do is this:
I want to have a JSP where the user browses for an image, and then clicks a submit button, I then want the selected image to be uploaded and stored...
My questions are:
1 - Can the image be stored in a MySQL database or does it have to be uploaded to a directory
2 - Is there a way to manipulate the image and make thumbnails etc in a Servlet?
3 - Is there a java API for doing things like this (if yes any chance of a url)?
Many thanks
Kris
Oh, and http://javaalmanac.com/egs/java.awt.image/CreateTxImage.html for the "making it smaller" bit ;-)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Cool thanks for the help exactly what I was looking for :0)
Good luck! :-)
Tim
Tim
ASKER
Having a few problems with this still, any chance you could give me a hand if i post the source code?
2) Yeah, sure... Load the image in to a BufferedImage, call getScaledInstance, and write the image back out again using the JPG compression routines (http://javaalmanac.com/egs/javax.imageio/BasicImageRead.html and http://javaalmanac.com/egs/javax.imageio/JpegWrite.html)
3) See 2 ;-)
Tim