I read online that it is possible to upload a blob string to aws using meteor-slingshot. Only problem is, whenever i pass the blob to the uploader i get a edgee_slingshot.js:283 Uncaught Error: Not a file
.
I am getting this object from my cropper:
{
width: 300,
height: 168,
type: "png",
string: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAokEjHVW7m2KLDU//lU/Of7KFtKzGCDnwAAAAASUVORK5CYII="
}
Then I extract the string as my blob:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAS.....CDnwAAAAASUVORK5CYII=
Then the uploader:
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);
}
});
Through the console i can see the error is being thrown from:
send: function (file, callback) { // 88
if (! (file instanceof window.File) && ! (file instanceof window.Blob)) // 89
throw new Error("Not a file");