• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in inserting image in Struts 1

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
https://coderanch.com/t/282147/JSP/java/java-io-FileNotFoundException
 
vivek mahajan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic