Forums Register Login

sample JSP code to upload file into database?

+Pie Number of slices to send: Send
hey all,
please give me the sample JSP source code to upload file as object into database.

thanks,
rahul
+Pie Number of slices to send: Send
I take it you mean as a binary BLOB field in the db ?
+Pie Number of slices to send: Send
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 ?

 
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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).
+Pie Number of slices to send: Send
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
If you try to please everybody, your progress is limited by the noisiest fool. And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


Reply locked
This thread has been viewed 3693 times.
Similar Threads
How to Dwonload a file using JSP?
How to list directory structure under a file server using java and jsp
Uploading xml to database
upload file using struts tag
problem when files/images/photos uploading into database and retrieving and displying
How Upload Image to DataBase
calling .js file from struts
upload code
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:55:18.