This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Struts and the fly likes How to store image file in specific folder Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to store image file in specific folder" Watch "How to store image file in specific folder" New topic
Author

How to store image file in specific folder

Satyajeet Kadam
Ranch Hand

Joined: Oct 19, 2006
Posts: 224
I am doing application in struts, in that iam uploading image file
Q1)Now i want to store that file under root context in image folder?

Q2) Is it possiable to store image in mysql? if possiable ? how?


I am pastin my code
Satyajeet Kadam
Ranch Hand

Joined: Oct 19, 2006
Posts: 224
Retriving the image from form bean and displaying it height gives error





Joan Horta Tosas
Ranch Hand

Joined: Feb 01, 2007
Posts: 59
That's because your trying to convert a FormFile object into a BufferedImage in this line

I suppose that myForm.getTheFile() returns a FormFile because you later have this line:
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Q2) Is it possiable to store image in mysql? if possiable ? how?

Yes. You can store it in a BLOB. This link shows you how.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to store image file in specific folder
 
jQuery in Action, 3rd edition