This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python 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: 2504
27
  • 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!