我正在尝试使用 Filestack (Filepicker) V3 上传多个文件并获取文件名、url 和 mimetype。因此,根据这个新版本的 Filestack 文档并在我得到这个之前遵循一个类似的问题:
var client = filestack.init('myapikey');
client.pick({
accept: 'image/*',
fromSources: ['local_file_system','googledrive','gmail','facebook','dropbox','onedrive','webcam'],
maxFiles: 5,
imageMax: [1024, 1024]
}).then(function(Blobs) {
console.log(JSON.stringify(Blobs));
var result = "";
for(var i=0; i<Blobs.length; i++){
result+=Blobs[i].filename + " : " + Blobs[i].url + " : " + Blobs[i].mimetype;
}
alert(result);
});
例如我上传了 2 个文件,在控制台中结果如下:
{"filesUploaded":[{"filename":"diploma1.jpg","handle":"1e3CkeZQaeokzS9TpcJM","mimetype":"image/jpeg","originalPath":"diploma1.jpg","size":258169,"source":"local_file_system","url":"https://cdn.filestackcontent.com/1e3CkeZQaeokzS9TpcJM","originalFile":{"customName":"diploma1.jpg"},"status":"Stored"},{"filename":"diploma2.jpg","handle":"kOejeHySTSG0TuSJWWlh","mimetype":"image/jpeg","originalPath":"diploma2.jpg","size":31072,"source":"local_file_system","url":"https://cdn.filestackcontent.com/kOejeHySTSG0TuSJWWlh","originalFile":{"customName":"diploma2.jpg"},"status":"Stored"}],"filesFailed":[]}
但是警报没有显示结果,我想得到这样的警报结果:
diploma1.jpg : https://cdn.filestackcontent.com/1e3CkeZQaeokzS9TpcJM : image/jpeg
diploma2.jpg : https://cdn.filestackcontent.com/kOejeHySTSG0TuSJWWlh : image/jpeg
我想要一些帮助。