• 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

Image preview before upload file in struts2.1.6

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to upload image to database, but before uploading the image I want to preview I image. I try to get help from Google not found any help there. So if anybody have worked on this kind of functionality, so please could you provide any hints how to progress. I searched through code ranch but couldn't figure out an exact solution. There are some other friends asked the same problem. but the result is same..
Thanks in advance !
What I have done is

jsp code


java script code

please help me...
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Struts, for the most part, is an implementation of the Front Controller Pattern with some helpful form tags thrown in. It has nothing to do with the client.
I don't know that you can view a local file with JavaScript. Once upon a time, my employer had a Java applet that had similar functionality (it calculated the size of an upload, estimated time and displayed progress). I assume most web controls that have a preview are done with Flash.
I'll toss this question to our JavaScript folks and see if they have any bright ideas.
 
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is a fairly recent post on this topic.
 
Pradeesh Pakkat
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Joe Ess,
thanks for your consideration towards my topic. But I have a doubt that link from Bear Bibeault's post is reffered as simple html form. I am using struts form tag. can I mix it up with the normal tag? If I do so how can I populate the value to the action class?

Bear Bibeault
Here is a fairly recent post on this topic.

 
Pradeesh Pakkat
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bear Bibeault,
thanks for the reply...
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Pradeesh Pakkat wrote:I am using struts form tag. can I mix it up with the normal tag? If I do so how can I populate the value to the action class?



Struts tags get processed into standard HTML tags. Take a look at the source for your form in the browser.
 
reply
    Bookmark Topic Watch Topic
  • New Topic