GWT文件上载如何工作? [英] How GWT fileupload works?

查看:153
本文介绍了GWT文件上载如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道 GWT 文件上传的工作原理吗?我知道 FileUpload 小部件以及如何使用它。我想知道它的内在机制是什么。我们无法从客户端的 FileUpload 小部件获取文件的内容,以及它如何进入服务器?我google了,但我没有得到解决方案。



在此先感谢。

解决方案

div>

GWT的文件上传 使用 HTML的输入元素 。 html input元素是原生html dom元素,它允许从系统中选择文件

选择后,您需要将其提交给您的服务器。这是由GWT的 FormPanel



特别是,FileUpload仅在FormPanel中使用时才有用,因为浏览器只会使用 表单提交 strong>。

注意: >你可以阅读有关如何使用formpanel和fileupload进行编码,如在这里回答@ 在GWT

2)如果您关心在客户端处理文件而不是将文件推送到服务器,那么您的选项有限正如在这里提到@如何从GWT FileUpload组件检索文件? >


Anybody know how GWT file upload works? I know about FileUpload widget and how to use it. I want to know what is its inner mechanism. We can't get contents of file from FileUpload widget in client and how it is going to server? I googled it but i didn't get solution.

Thanks in advance.

解决方案

GWT's file upload makes use HTML's input element. The html input element is native html dom element which allows to select files from your system.

After selection you need to submit it to your server. This is done by the GWT's FormPanel.

In particular, FileUpload is only useful when used within a FormPanel, because the browser will only upload files using form submission.

Note:

1) You can read about how to code with formpanel and fileupload as answered here @ Basic File upload in GWT

2) If you are concerned with processing the file on client side and not pushing the file to server then you have limited options as mentioned here @ How to retrieve file from GWT FileUpload component?

这篇关于GWT文件上载如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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