• 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
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

Download Files in the MS Windows Operating System

 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The operating system in my PC is the MS Windows.

I use JSF and the Spring MVC framework.

How do I prompt the usual Windows dialog box, the box we have seen all the time, into the browser asking "Do you want to open or save this file?" with three buttons: Open, Save, and Cancel?

I am undertaking this task: users select "Generate MS Word Document" from a menu, which first invokes a method to retrieve requested information from the database and then uses some utility classes to format the information into a MS Word document. Thereafter, I prompt a dialog box into the browser asking users where in their local directory tree (i.e. the C: drive) the document is to be saved.

Thanks for advices.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the JSF forum.
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just pass it as a file to the HttpServletResponse.

Basic example:getFilePath() and getFileName() are self-explaining.
They should look like "c:/path/to/file/filename.ext" and "filename.ext".
[ October 23, 2006: Message edited by: Bauke Scholtz ]
 
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot for the explanation and the code.
 
We don't have time for this. We've gotta save the moon! Or check this out:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic