我可以在GWT FileUpload中指定一个文件类型吗? [英] Can I specify a file type in GWT FileUpload?

查看:126
本文介绍了我可以在GWT FileUpload中指定一个文件类型吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Gwt应用程序,并使用 FileUpload 来允许用户上传文件。
只有特定类型的文件将被接受,我有验证检查文件类型,一旦用户选择了上传,但我想知道是否有一种方法,只有在上传对话框中显示具有特定扩展名的文件box。



例如如果用户必须上传 .doc 文件,那么我只希望他们能够看到文件夹和.doc,而不是所有文件类型。

$ b $根据我的知识

没有一种程式化的方式来显示具有特定扩展名的文件上传对话框。



您需要对所选文件进行验证


I have a Gwt application and use a FileUpload to allow users to upload files. Only certain types of files will be accepted and I have validation to check the file types once the user has selected it for uploading but I want to know if there is a way to only show files with certain extensions in the upload dialog box.

E.g. If the user has to upload a .doc file then I only want them to be able to see folders and .doc's, not All file types.

解决方案

As per my knowledge

There is no programmatical way to only show files with certain extensions in the upload dialog box.

You need to put validations on selected file

这篇关于我可以在GWT FileUpload中指定一个文件类型吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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