In my jsf application files names are displayed using datatable component with checkbox option for each files and their is a single download button. When user select any file and click download button it should download into client machine default folder set by browser or into specified folder.For Example:(D:/dstoreFiles) Without dispalying save/open/cancel dialogue box. Application is developed using eclipse.
1 Answers
Without dispalying save/open/cancel dialogue box.
That is not possible using standard HTTP/HTML means as that would be a security breach. You don't want that a website is able to write an arbitrary file to an arbitrary location of your local disk file system without any form of confirmation whenever you just visit a page, do you? As JSF is basically a MVC framework sitting on top of HTTP/HTML, it can't do any magic for you in order to get it to work anyway.
In Java terms, that's only possible using a signed(!!) applet or webstart (JNLP) application. You can then embed this in your JSF (read: HTML) page using <applet>
or <object>
tag. You can if necessary use a simple servlet to let the applet in the webbrowser interact with code in the webserver.

- 1,082,665
- 372
- 3,610
- 3,555
-
I'm very grateful to you for reply. But how it is possible to download files from internet into default folder. I know default download folder location is defined in browser setting. For Example when i download pdf files, images,zip files and others they automatically saved into download folder.How it is achieved. Any help will be appreciated. – nagesh Mar 01 '13 at 06:51
-
This is a browser setting. – BalusC Mar 01 '13 at 11:21