• 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

File Download functionality in Struts 1.x

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a requirement where if the user clicks on the Download icon with respect to an XML file, the user should be prompted with a dialog for either "Open" or "Save" or "Cancel" the operation. Right now, all these are working fine. But the new requirement is that, on click of the "Open" command xml file should be direclty opened , or if "Save" button is clicked then the file should be saved as "tar.gz" file with custom defined folder structure defined in the server code.

My question is how do we invoke the server code when the file is already flushed to the output stream, and how do we make sure on click of te save button it will call the server code.

Here is a snap shot of download function
Download.png
[Thumbnail for Download.png]
 
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
That dialog is created by the browser, so we don't have control over it. You could provide two links on your page to open/save. Perhaps you could create a dialog with JavaScript to mimic the download dialog.
 
Aaaaaand ... we're on the march. Stylin. Get with it 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