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

Displaying uploaded images in jsp  RSS feed

 
Santhana Lakshmi.S
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In my project,the users are allowed to uploade images.
I did the uploading of images and stored in the server in a directory and also i stored the link in the database.
Now i want to display the images that uploaded in the server to change the image name like that.
I tried like this by taking the image link from the database
<img src="<%=rs.getString(2)%>" />
I write the above line the while(rs.next()) loop in order take the values fromt the database.
This is working fine for displaying images.
For each image i ve to give a textbox to change the image name as user likes.
for that i mentioned the <input> tag within the loop by doing so im unable to get the values added in the each text box.
Can anyone tell me how to do this?
And one more can anyone tell me how to read and display the image that stored in the server.
I stored the uploaded image in this mywebapp/username/foldername/file1.jpg,
mywebapp/username/foldername/file2.jpg like this.
Can anyone help me out in this.
Thanx a lot in advance.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What errors are you getting while using input field in loop?

You can InputStream to read the image and response OutputStream to project the image to browser. Dont forget to set the content type using setContentType() method. For example response.setContentType("image/jpeg");
[ April 25, 2006: Message edited by: Adeel Ansari ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!