我可以使用以下jQuery代码使用ajax请求的POST方法执行文件上传吗?
$.ajax({
type: "POST",
timeout: 50000,
url: url,
data: dataString,
success: function (data) {
alert('success');
return false;
}
});
如果可能,我是否需要填写data
部分?这是正确的方法吗?我只将文件发布到服务器端。
我一直在搜索,但是我发现是一个插件,而在我的计划中我不想使用它。至少目前是这样。
Here was an idea i was thinking of:
Have a form in which you move the INPUT:File element to.
The result will post to the frame, and then you can just send the fetched data up a level to the image tag you want with something like:
and the page loads.
I believe it works for me, and depending you might be able to do something like: