File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to store image file in specific folder

 
Satyajeet Kadam
Ranch Hand
Posts: 224
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 224
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Retriving the image from form bean and displaying it height gives error





 
Joan Horta Tosas
Ranch Hand
Posts: 59
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic