简体   繁体   English

带有进度条的jquery.form.js文件上传,服务器端php脚本中有什么内容?

[英]jquery.form.js file upload with progress bar, what goes in server side php script?

I am trying to set up file upload function as in http://jquery.malsup.com/form . 我正在尝试像http://jquery.malsup.com/form一样设置文件上传功能。 But the example for file upload with progress bar do not have the server side script example. 但是,带有进度条的文件上传示例没有服务器端脚本示例。

All that i know is to process the $_FILES, $_POST, sanitise, and save; 我所知道的就是处理$ _FILES,$ _ POST,清除并保存; but not able to figure how to send progress bar data from server to browser. 但无法说明如何将进度条数据从服务器发送到浏览器。 I am not sure how uploadProgress get data from file_echo2.php in the example http://www.malsup.com/jquery/form/progress2.html 我不确定在示例http://www.malsup.com/jquery/form/progress2.html中 uploadUpgress如何从file_echo2.php获取数据

Can some one hint me in how to capture the file upload progress while it is uploading? 有人可以提示我如何在文件上传过程中捕获文件上传进度吗? Thanks in advance. 提前致谢。

Well there is nothing that needs to be done on the server side script ! 好了,服务器端脚本不需要做任何事情! On the client side javascript, hook a function to handle uploadProgress event. 在客户端javascript上,挂钩一个函数来处理uploadProgress事件。 uploadProgress returns the values event, position, total, percent. uploadProgress返回值事件,位置,总数,百分比。 make use of percent value to show a progress bar or any other way you want it behave. 利用百分比值显示进度条或您希望其表现的任何其他方式。

I had particularly zeroed on this (among a wide variety of choices like plupload , uploadify etc) because it do not use any flash files. 我对此特别关注(在诸如pluploaduploadify等各种各样的选择中),因为它不使用任何Flash文件。 Now that i learnt that this needs no special server side script to handle is a huge plus point. 现在,我了解到这不需要特殊的服务器端脚本来处理是一个很大的优点。

Many thanks to malsup and more details at jquery plugin 非常感谢malsup和jquery插件的更多详细信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM