• 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
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
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.
 
This tiny ad is wafer thin:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic