我可以在GWT FileUpload中指定一个文件类型吗? [英] Can I specify a file type in GWT FileUpload?
问题描述
我有一个Gwt应用程序,并使用 FileUpload
来允许用户上传文件。
只有特定类型的文件将被接受,我有验证检查文件类型,一旦用户选择了上传,但我想知道是否有一种方法,只有在上传对话框中显示具有特定扩展名的文件box。
例如如果用户必须上传 .doc
文件,那么我只希望他们能够看到文件夹和.doc,而不是所有文件类型。
没有一种程式化的方式来显示具有特定扩展名的文件上传对话框。
您需要对所选文件进行验证
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屋!