var avFile = new AV.File(name, file); 这个file接收什么样的类型,对象吗?
用img为什么总是不行?img.scr报错,说是不能用string
var img = document.querySelector('#imgTest');
console.log(img);
var post = new AV.Object("Post");
avFile = new AV.File('test', img);
post.save({
content: "每个 JavaScript 程序员必备的 8 个开发工具",
pubUser: "LeanCloud官方客服",
photo: avFile
}, {
success: function(post) {
console.log('实例已经成功保存.')
},
error: function(post, error) {
console.log('失败了.')
}
});