Home  >  Article  >  Backend Development  >  不用flash怎么实现文件上传的进度显示

不用flash怎么实现文件上传的进度显示

WBOY
WBOYOriginal
2016-06-06 20:24:061171browse

如题?

UEditor不是flash,它是怎么做到的呢?

UEditor在还没有上传图像时就能“读到图片”,点击上传后在真正的上传,这个怎么做到的呢?

html5?

需要服务器端配合? (必须启用PHP的扩展APC或pcel模块)

网大神解答下,谢谢!

回复内容:

如题?

UEditor不是flash,它是怎么做到的呢?

UEditor在还没有上传图像时就能“读到图片”,点击上传后在真正的上传,这个怎么做到的呢?

html5?

需要服务器端配合? (必须启用PHP的扩展APC或pcel模块)

网大神解答下,谢谢!

有个叫xhr2的东西,比1里多了几个事件,可以根据那几个事件来计算上传进度,但是要用这个低版本浏览器就别考虑啦!?

http://php.net/manual/en/session.upload-progress.php
官方有demo~看下就知道了
这里还有个Demo 用了 jquery form 你看看 查看下源代码
http://malsup.com/jquery/form/progress.html

IE10以下还是考虑flash吧 当然如果你要硬说抖机灵的话不是还有sliverlight么

可以做个伪进度条,?。
或者和后端配合吧,隔一点时间就向后端请求一下进度吧。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn