• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

uploading a word doc/excel files

 
Bala'J'i Rags
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a application which has an requirement like uploading a word/excel document into a database table from a jsp view using hibernate or JDBC API .(Like the user browses the file to upload and clicks on a upload button).Can anyone help me with some suggestion and tips on the ways to upload /download documents to a table.


Thanks in advance..
[ December 04, 2008: Message edited by: Bala'J'i Rags ]
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you have so far? Is the problem the uploading of the file to the servlet container, or the saving of the uploaded file to the database?
 
Bala'J'i Rags
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It focuses on saving the file in an oracle table..Sorry if the post was ambiguios
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use an attribute of type BLOB to store binary data in a database. JDBC supports this through the setBlob and setBinaryStream methods in PreparedStatement, and the getBinaryStream in ResultSet.

I generally advise against storing files in a database. I'd store them somewhere in the file system, and just keep the filename and directory information in the database.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic