GWT Toolkit:在客户端预处理文件 [英] GWT Toolkit: preprocessing files on client side

查看:96
本文介绍了GWT Toolkit:在客户端预处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果客户端 GWT 代码有一种方法可以预处理客户端计算机上的文件?
例如,在将文件提交给服务器之前,计算它的校验和。

If there's a way for the client side GWT code to pre-process a file on the client computer? For example, to calculate a checksum of it before submitting the file to the server.

推荐答案

可能。对文件的操纵是由浏览器完成的,而不是HTML代码。

No it is not possible. The manipulation of the file is done by the browser, not the HTML code.

想想看,GWT是100%的javascript。而且JavaScript无法访问您计算机中的任何文件。这将是一个相当大的安全风险! GWT包装文件输入框,以便它可以显示在GWT面板内。但是,一旦按下上传按钮,上传就由浏览器完成。

Think about it, GWT is 100% javascript. And javascript has no access whatsoever of the file in your computer. That would be an pretty big security risk! GWT "wraps" the file input box so it can be displayed inside the GWT panel. But once you press the "upload" button, the upload is done by the browser.

然而,您可以使用其他技术进行文件操作。例如Java小程序。但是,这是GWT区域之外......

You could do file manipulation with another technology however. Java applets for example. But that is outside of GWT area...

这篇关于GWT Toolkit:在客户端预处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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