ajax 发布上传进度 - 仅限客户端
我有一个表单,用户可以从中选择 100 个文件上传到我的服务器。
提交表单时,会向服务器发出一个可能长达数百 MB 的 POST 请求。我希望用户看到一个进度条来查看他们上传了多少。
我的问题如下:有没有办法只在客户端JS中实现这一点?我更愿意在不调用服务器上的 jsp 或 php 文件的情况下执行此操作。
我们可以使用 ext.js,但不能使用 jquery。
非常感谢,休
I have a form from which users can select 100s of files to upload to my server.
When submitting the form a post request is made to the server which may be 100s of MBs long. I would like the users see a progress bar to see how much they have uploaded.
My question is as follows: is there any way to achieve this in client side JS only? I would much prefer to do it without making a call to a jsp or php file on the server.
We can use ext.js but not jquery.
Many thanks, Hugh
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不会。标准 HTML
某些浏览器(例如 Google Chrome)会不显眼地显示
No. Standard HTML
<form>
uploads don't expose their upload progress to JavaScript, so upload progress scripts have to either:Some browsers (such as Google Chrome) will unobtrusively display the progress of a
<form>
upload (e.g, in the status bar), but many don't, and there's no way I'm aware of to retrieve that data from within the page.