aspose file tools*
The moose likes Servlets and the fly likes sample JSP code to upload file into database? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

sample JSP code to upload file into database?

rahul saxena
Greenhorn

Joined: Jun 10, 2003
Posts: 17
hey all,
please give me the sample JSP source code to upload file as object into database.

thanks,
rahul
Ben Keeping
Greenhorn

Joined: Jan 19, 2005
Posts: 10
I take it you mean as a binary BLOB field in the db ?


Free Java Database Connection Pooling Software<br /><a href="http://www.primrose.org.uk" target="_blank" rel="nofollow">primrose.org.uk</a>
rahul saxena
Greenhorn

Joined: Jun 10, 2003
Posts: 17
hi what for FileInputStream object used in the following code???

thanks



Originally posted by Ben Keeping:
I take it you mean as a binary BLOB field in the db ?
sandip mense
Greenhorn

Joined: Oct 14, 2003
Posts: 28
Rahul,

The FileInputStream is used to read streams of raw bytes such as image data. It obtains input bytes from a file in a file system.

Sandip
Ben Keeping
Greenhorn

Joined: Jan 19, 2005
Posts: 10
Your question is "how to upload file into a database" - so you use the FileInputStream to read the file ! Try out the API docs ...

Also, please do not crosspost threads (Servlet forum and JSP forum).
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

This thread is a duplicate of the one here.

Please don't post the same question in multiple forums, it creates duplicate conversations and wastes the time of the people trying to help you. Like we have here.

Personally I think they should both be closed and one copy moved to JDBC, but since I have no control over the other forum this thread is closed.

Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sample JSP code to upload file into database?