ajax file upload

jQuery Ajax文件上传

和自甴很熟 提交于 2020-10-06 09:28:06
问题: Can I use the following jQuery code to perform file upload using POST method of an ajax request ? 我可以使用以下jQuery代码使用ajax请求的POST方法执行文件上传吗? $.ajax({ type: "POST", timeout: 50000, url: url, data: dataString, success: function (data) { alert('success'); return false; } }); If it is possible, do I need to fill data part? 如果有可能,我是否需要填写 data 部分? Is it the correct way? 这是正确的方法吗? I only POST the file to the server side. 我只将文件发布到服务器端。 I have been googling around, but what I found was a plugin while in my plan I do not want to use it. 我一直在搜索,但是我发现是一个插件,而在我的计划中我不想使用它。 At least for the moment. 至少目前是这样。