简体   繁体   English

传递文件上传jQuery和Ajax

[英]Passing file upload jquery and ajax

I am trying to upload file Jquery with ajax using php. 我正在尝试使用php使用ajax上传文件Jquery。 If i passing Jquery data i not able to retrieve the file upload data how can i pass jquery file upload data to ajax. 如果我传递Jquery数据,我无法检索文件上传数据,我如何将jquery文件上传数据传递给Ajax。 Kindly some on help me how can upload file through jquery ajax with php.. 请帮助我如何使用php通过jquery ajax上传文件。

You cannot AJAX upload. 您无法上传AJAX。

It's basically a fake AJAX to make it look like it is AJAX uploading. 从本质上讲,它是一种伪造的AJAX,使其看起来像是在上载AJAX。

In reality what happens is that the upload form is given a target of a nearby iframe. 实际上,发生的情况是为上传表单指定了附近iframe的target This makes it look like it is AJAX uploading when in reality it isn't. 实际上,实际上它不是AJAX上传。

The iframe is normally given a JS function within size of it that triggers a function in the parent windows which shows some kind of message say "Thank you for your upload". 通常,在iframe的大小范围内会为其提供JS函数,该函数会在父窗口中触发一个函数,该窗口会显示某种消息,例如“谢谢您的上传”。

Of course this is only really basic functionality and you'll need to Google search for more exampls, fortunately there are tonnes out there. 当然,这只是真正的基本功能,您将需要Google搜索更多示例,所幸还存在很多其他功能。

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

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