开发者

Java, ICEFaces and folder browse / select dialog

I'm currently developing an ICEFaces web application and I need a folder browsing / selection control. Anyone found a solution to this?

Additional info: The application generates files that has to be stored on the local machine, so the user has to choose wher开发者_开发技巧e this should be.


You can use the

<ice:inputFile/>

component. Through this you will be able to do the file uploads flawlessly.

<ice:inputFile id="inputFile1" actionListener="#{bean.ipfActionListener}"
 fileNamePattern=".+\.xls" uniqueFolder="true" uploadDirectory="<Your Location>"/>

The above fragement will filter files with .xls extension while displaying the filechooser dialog.


ICEfaces does not have access to the file system on the web browser computer for security reasons. So there is no ICEfaces component for choosing a directory to download a file into. Other JavaScript libraries have the same limitation.

Normally, when a non-displayable file such as a ZIP file is download the web browser prompts you to save the file. My Firefox web browser has the option 'Always ask me where to save files' and with this option I get a native file selection dialog and can control where each downloaded file is stored. Can you use this approach instead?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜