Win a copy of Design for the Mind this week in the Design forum!
    Bookmark Topic Watch Topic
  • New Topic

sample JSP code to upload file into database?

 
rahul saxena
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Report post to moderator
hey all,
please give me the sample JSP source code to upload file as object into database.

thanks,
rahul
 
Ben Keeping
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Report post to moderator
I take it you mean as a binary BLOB field in the db ?
 
rahul saxena
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
 
    Bookmark Topic Watch Topic
  • New Topic