Click here to Skip to main content
15,890,690 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
code to insert a file (doc file) to datbase for a jsp website when a submit button clicked
Posted
Updated 7-May-13 21:05pm
v2
Comments
Shubhashish_Mandal 8-May-13 4:06am    
did you try this? Instead of asking for code,tell us what problem you have face?

1 solution

File file1 = new File(docpath);
FileInputStream fis1 = new FileInputStream(file1);

Then use prepared statement to insert in database

ps.setBinaryStream("your column index of database", fis1, (int) file1.length());
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900