• Post Reply Bookmark Topic Watch Topic
  • New Topic

uploading photo to database  RSS feed

 
ronald silva
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi.
I would like to upload a photo, using form (html/jsp) to a servlet to a database (postgresql).

I have no idea how to do.

maybe the code of jsp:

input type ???


maybe the code of servlet:


after openning a conection to database (postgresql), how to insert the image?

and how to retrieve the image from database?

in the tablet in the database, I would like to make this:





 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66158
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's a bit more complicated than that. See the following Servlets FAQ entry: https://coderanch.com/wiki/660188/File-Upload
 
ronald silva
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no one can help me?
 
Paul Clapham
Sheriff
Posts: 22378
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apparently not. The link that Bear posted was intended to help you. So are you having a problem with that FAQ page? If so, what is that problem? Just giving up isn't going to get you anywhere.
 
ronald silva
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The link that Bear posted didnt help me.

I need to know how pass the file/image from FORM  to SERVLET and save into POSTGRESQL.

 
Paul Clapham
Sheriff
Posts: 22378
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No help?

Okay, let's start with the first line of that FAQ entry.

If you are using Servlets 3.0 or later, see the Servlet Specification for information on uploading files.


So... are you using Servlets 3.0 or later?
 
Paul Clapham
Sheriff
Posts: 22378
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One other thing: Your question looks like "I want to do A and B". The best way to handle such questions is to find out how to do A, and then find out how to do B. There may be glue necessary to connect the two answers once you find them, but it's still preferable to solve the two problems separately. So I'd suggest that you separate the "upload a file" and "insert a file into a database table" questions into separate projects.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!