Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

saving a file into postgresql (from form)  RSS feed

 
ronald silva
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi.
how do I save a file into postgresql?
I am using those codes:
jsp:


and the servlet:



my doubt is in this last line: ps.setBinaryStream (1,contarq, (int)contarq.available() ); 
can not save a inputstream directly in postgresql?

oh, the database in postgresql has a table (images) and a column (img) type bytea.

what I need to edit in those codes , in order that works?
 
Dave Tolls
Ranch Hand
Posts: 2818
30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What error do you get?

Have you tried just saving the file to disk on the server to see that it is transmitted correctly?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!