在浏览器中显示文件上传到 servlet 的状态

发布于 2024-09-18 07:59:40 字数 108 浏览 1 评论 0原文

我需要在浏览器中显示文件上传到 servlet 的状态,如何在不使用 jquery 之类的库的情况下实现这一点,执行此操作的各种选项有哪些,哪一个是最好的?

最好的问候,
克沙夫

I need to show the status of file upload to servlet in the browser, how can this be acheived without using any libraries like jquery, what are the various options for doing this and which one is the best?

Best Regards,
Keshav

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

变身佩奇 2024-09-25 07:59:40

如果根本不使用任何附加组件,您就不能,至少在当前所有流行的浏览器中不能。有一些基于 Flash 的上传器可以做到这一点,并且在一些较新的浏览器中可以使用与 HTML5 相关的文件 API。在旧版浏览器 (IE) 中,您根本无法访问客户端文件系统,因此您的 Javascript 代码不会知道文件大小。

Without using any add-ons at all, you can't, at least not in all currently-popular browsers. There are some Flash-based uploaders that can do it, and in some newer browsers there's an HTML5-related file API that could be used. In older browsers (IE), you have no access at all to the client-side filesystem, so your Javascript code won't have any idea of the file size.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文