Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in inserting image in Struts 1  RSS feed

 
vivek mahajan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
I want to insert image file into the database for that i am using Bean as follows

and in my Action Class i am using the form bean as

I am getting an exception as java.io.FileNotFoundException: demo.jpeg (No such file or directory)
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
 
vivek mahajan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sagar
But the page which you suggested me shows the same technique as I have used with JSP and servlets (enctype="multipart/form-data"). With Struts do I need to follow the same technique or it has some thing different for form upload.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vivek mahajan wrote:With Struts do I need to follow the same technique or it has some thing different for form upload.

Not really, but you can any time use Struts 1 FormFile class to leverage the file upload thing
Here are the two links I found:
http://wiki.apache.org/struts/StrutsFileUpload
http://www.vaannila.com/struts/struts-example/struts-file-upload-example-1.html
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!