This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

uploading file to database

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to upload an entire .doc file into oracle database using struts

when clicked on browse button and select the file from the list and when click on submit the entire file(resume) should be stored in the database
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the struts-examples.war file that comes with the Struts download, and you will find an example that shows you how to upload a file.

Once you have uploaded the file, you will probably want to store it in a BLOB (Binary Large OBject) in your Oracle database. I'd suggest searching on "Oracle BLOB Java" to find examples of how to read and write a BLOB in Oracle.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I've been looking at a similar issue so I hope nobody minds me piggy-backing on this thread.
I've used the example struts upload code before, but now I'm trying to use a
DynaValidatorForm instead of handcrafting an actionForm. I've set my form property to this:



This config executes fine, but I've run out of ideas of how to cast the org.apache.struts.upload.CommonsMultipartRequestHandler$CommonsFormFile back to a FormFile object in my action class. I had though something like this would work:



I've also tried creating a CommonsMultipartRequestHandler object and inspecting its properties, but no luck there either.

Any ideas, pointers, hints or tips greatly appreciated.
Cheers,
Kem
 
get schwifty. tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!