• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

display Formfile from struts form in session scope

 
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,
i have a struts form with FormFile, it works fine with no issues.
My requirement is when a user selects a file, and click next he is taken to the review stage.
i was wondering can i display the formFile object from Strust action form which is in session
in the review stage.
Once the user reviews he clicks save and then i upload the file nad copy it on to my server.

please let me kwwo
thanks
 
Darvesh Niz
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello all i hope i made sense

Can anyone please reply if you have any clue.
Basically i dont want to save the Form File to a temp location and show it, since i a users exists in review stage, i have to clean the directory

 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not very good at struts 1, but if your FormFile object is in the session, then you can create an action which will call the getInputStream method on the FormFile object and send that stream to the client. The HTML will use the src attribute to point to that action on the <img tag i.e. something like [tt]<img src="getImage.do" /> . The file must be stored temporarily on the server by Struts, so you can generate a direct link to the file too, but I'm not sure how Struts 1 is configured as to where to save the file...
 
Darvesh Niz
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks
That what i am doing right now, when the user selects a file and goes to review state, i store the file in temp location on my server. once the user clicks save, then i move the file from temp location to actual location and deletes teh temp location.

i thought it might be easier if there is a workaround to display the using using the fileForm property in struts, since many times what happens is that a user comes until review stage and then leaves, in this case teh temp folder has the files left there which are obsolete, ofcourse i can go and manually delete teh file.

Any cleaner way to workaround this issue

Thanks
 
When I was younger I felt like a man trapped inside a woman’s body. Then I was born. My twin is a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic