GWT浏览文件/目录 [英] GWT Browse files/directories

查看:59
本文介绍了GWT浏览文件/目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的要求:

在我的应用程序中,我想从用户那里获取文件的路径并相应地处理该文件.

In my application, I want to get a path of file from user and process the file accordingly.

我正在提供一个文本框,用户可以在其中直接输入路径.

I am providing a text box in which user can directly enter the path.

或者用户可以通过单击浏览"按钮并选择一个文件来选择文件.

Or user can opt to choose a file by clicking on Browse button and selecting a file.

我应该使用哪个小部件来浏览本地文件和目录?

Which widget shall I use to browse local files and directories?

我找到了一个名为FileUpload的小部件,但是每当我通过fileUpload.getFileName获得fileName时,它都不会提供完整的路径.

I found one widget called FileUpload but whenever I get the fileName by fileUpload.getFileName, it does not give me the whole path.

推荐答案

您不需要整个路径.

请参见下面的链接.

第一个链接涵盖客户端,第二个链接涵盖servlet端.

The first link covers the client side and the second one the servlet side.

http://gwt.google.com/samples/Showcase/Showcase .html#!CwFileUpload

http://commons.apache.org/fileupload/using.html

这篇关于GWT浏览文件/目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆