有任何示例显示如何将 blobstore api 与 ajax 一起使用?
当我使用表单时工作正常,但如果我使用 jquery,我不知道如何发送文件,我收到此错误:
blob_info = upload_files[0]
IndexError: list index out of range
我在javascript中有这段代码
function TestAjax()
{
var nombre="Some random name";
ajax={
type: "POST",
async:true,
//dataType:"json",
url:"{{upload_url}}",
data:"nombreEstudio="+nombre,
error: function ()
{
alert("Some error");
$("#buscando").html("");
},
success: function()
{ alert("it's ok") }
};
$.ajax(ajax);
}
当我使用表单文件时,它使用输入标签发送(就像文档的示例一样)