简体   繁体   English

使用Ajax上传文件

[英]File upload using Ajax

can anyone guide me how to upload a file thorugh ajax 谁能指导我如何上传文件thorugh ajax

when users click on Upload, i'm opening a div and users click on submit button, i'm calling an ajaxfile 当用户单击“上载”时,我正在打开一个div,而用户单击“提交”按钮时,我正在调用ajaxfile

upload : 上载:

1) How can i get these values in javascript ? 1)我如何在javascript中获取这些值?

$name = $_FILES['profile']['name']; $ name = $ _FILES ['profile'] ['name']; $temp = $_FILES['profile']['tmpname']; $ temp = $ _FILES ['profile'] ['tmpname'];

so that i can pass to the ajaxfile and do the necessary functionality... 这样我就可以传递给ajaxfile并执行必要的功能...

Am i going in a correct way ? 我要走正确的路吗?

Thanq 坦克

Make an ajax request to php script which returns these data. 向php脚本发出ajax请求,以返回这些数据。

http://www.ajaxf1.com/tutorial/ajax-file-upload-tutorial.html - tutorial about uploading files with ajax. http://www.ajaxf1.com/tutorial/ajax-file-upload-tutorial.html-有关使用ajax上传文件的教程。

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

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