如何使用Ajax调用和PHP上传图像?

时间:2017-04-02 09:42:35

标签: php jquery ajax

我需要通过使用ajax调用将文件数据发送到php端来将图像上传到文件夹中。我在下面解释我的代码。

<input type="file" id="sortpicture" onChange="this.parentNode.nextSibling.value = this.value">

我的JavaScript代码如下所示。

var file_data = $('#sortpicture').prop('files')[0];

我需要使用ajax和PHP将此文件存储到文件夹中。

0 个答案:

没有答案
相关问题