如何使用javascript创建上传进度条 [英] how to create the upload progress bar using javascript

查看:79
本文介绍了如何使用javascript创建上传进度条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用php将文件上传到客户端的服务器,HTML和javascript。

i am using php to upload the file to server, HTML and javascript on the client side.

我想创建一个确定的进度条,该文件的进度上传,使用javascript

i want to create a determinent progress bar which progress of the file upload,using javascript

注意,
fresher

Regard, fresher

推荐答案

我想我会在讨论中添加几句话:)

I thought i will add a few words to discussion :)

据我所知,你无法仅通过Javascript监控文件上传。

Javascript是动态更新客户端的工具 - 您的进度条。

As far as I know you are not able to monitor file upload from Javascript only.
Javascript is tool to dynamically update client side - your progress bar.

意味着您的解决方案实际上取决于您对服务器计算机的控制。

要跟踪文件进度,您可以编写服务器端脚本或使用http server内置函数。同样取决于您的服务器,这可以是PHP Pecl扩展的功能,服务器上文件的简单Perl脚本签入状态等。

Means your solution really depends on control you're having over the server machine.
To follow file progress you can write server side script or use http server built in functions. Again depending on your server, this can be PHP Pecl extensions' functions, simple Perl script checkin status of the file on server, etc.

注意:你可以此处还添加了另一种客户端技术 - Flash,可以监控已发送文件的状态。

这篇关于如何使用javascript创建上传进度条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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