我在网上看到,可以使用meteor-slingshot将blob字符串上传到aws。唯一的问题是,每当我将blob传递给上传者时,我都会获得ApplicationDbContext
。
我从裁剪器中获取此对象:
edgee_slingshot.js:283 Uncaught Error: Not a file
然后我将字符串提取为我的blob:
{
width: 300,
height: 168,
type: "png",
string: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAokEjHVW7m2KLDU//lU/Of7KFtKzGCDnwAAAAASUVORK5CYII="
}
然后是上传者:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAS.....CDnwAAAAASUVORK5CYII=
通过控制台我可以看到错误:
let uploader = new Slingshot.Upload("example");
uploader.send(blob, function(error, url) {
if (error) {
console.log(error, "An error happened during the upload.");
}
if (!error) {
console.log("success, here is the url: ", url);
}
});