• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Displaying uploaded images in jsp

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic