Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android 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: 2667
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?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!