如何AJAX文件上传工作?

编程入门 行业动态 更新时间:2024-10-23 17:29:42
本文介绍了如何AJAX文件上传工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们知道,JQuery的(或JavaScript)不能访问本地文件系统。那么,如何jQuery的各种AJAX文件上传插件实际工作,甚至显示进度条?

We know that, JQuery ( or javascript ) can not access local file system. So how does the various ajax file upload plugins of jquery actually work and even show the progress bar ?

我曾把使用Java小程序的文件上传,我可以做到这一点,因为在某种程度上,我能够读取使用小程序中的本地文件系统中的文件。因为我能读它,我把它一个100行的时间为100线多个部分,每个部分的发送成功使用 ajax.post ,操作进度条相应。

I once made an File Uploader using Java Applet and I could do it because somehow I was able to read the file from the local file system using applet. Because I was able to read it, I sent it a 100 lines at a time using ajax.post in multiple parts of 100 lines and as each of the part is successfully sent, manipulated the progress bar accordingly.

但是,当我们不能读取文件系统中的文件,然后怎么做的jQuery的AJAX插件显示进度条和上传文件异步?

But, when we can not read the file from file system, then how do the ajax plugins of jquery show the progress bar and upload the files asynchronously ?

推荐答案

通常情况下,有在服务器端的处理程序接受后,又接连处理报告任何上传的进度。

Typically, there is a handler on the server side accepting the post, and then another handler to report progress of any upload.

如果你举个例子框架来使用,我们可以给出一个更明确的答案。

If you give an example framework to use, we can give a more specific answer.

更多推荐

如何AJAX文件上传工作?

本文发布于:2023-11-28 15:36:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1642987.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件上传   工作   AJAX

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!