Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

how to display a dialog box that allows the user to specify the path and name the download file

I have an J2ee application that need to allow users to export data to xml file to their local desktop. We need to open a dialog box that can allow user to browse their local drive to specify the directory and aslo be able to specify the new file name (the file is not exist on local yet). How can I achieve that in JSP page? Is there any built-in funtion?
0
AnnieDing
Asked:
AnnieDing
  • 3
  • 2
1 Solution
 
Ajay-SinghCommented:
You have to set Content-Disposition header,

http://forums.devx.com/showthread.php?t=145024
0
 
AnnieDingAuthor Commented:
My question is not about downloading files. The application is using Marshaller to marshal all my object to a XML file. I want user to be able to select the directory on their local drive and also be able to specify the exported file name. How can I open up this kind of dialog box? I tried <html:file> tag, but it has to choose a existing file. I want user to be able to enter a new file name.
0
 
AnnieDingAuthor Commented:
In addition, I am asking how to open a download dialog box.
0
 
AnnieDingAuthor Commented:
I find the answer: using JFileChooser chooser = new JFileChooser();
0
 
Ajay-SinghCommented:
> In addition, I am asking how to open a download dialog box.
I believe, thats done by browser.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now