Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

use photographs in the database like orkut.com

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
i am working on a post resume and picture application
and now i have picture and resume in database
i wanna show the list of resumes with the pictures displayed in the list
i know how to downlaod the picture but how to put tht in image tag
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<html:img action="/myDownloadAction" />
 
ramandeep singh
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<html:img action="/myDownloadAction">
this will give me a link to the action page
but how to receive image from database
and display it in the list with pictures
like the list of people who sent you scrap in orkut
the picture of person is also there
and my picture is in database
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have written code to do this in the past. Basically what you need to write is an action that will read the image from the database and stream the binary image back. You will then use the syntax that Merrill provided to call this action (it does not give you a link).

I have heard of the DownloadAction that is included with Struts but I have not used it (looks like since 1.2.6...I think I am using 1.1). If you are using 1.2.6 or newer, I suggest that you use DownloadAction. If you are using an older version I suggest that you download the 1.2.6 source code and look at how DownloadAction works. It is likely only about 20 lines of code.

http://struts.apache.org/1.x/struts-extras/apidocs/org/apache/struts/actions/DownloadAction.html

- Brent
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This link has an example of reading from a BLOB in a database and downloading it.
 
reply
    Bookmark Topic Watch Topic
  • New Topic