我一直收到Invalid argument in put at index 0: Expected Blob or File
错误。有趣的是,论证完全是一个档案......
以下是代码:
var file = document.getElementById('cke_69_fileInput')
.contentWindow.document.getElementById('cke_69_fileInput_input').files[0];
var storageUrl = 'noticias/imagenes/';
var storageRef = firebase.storage().ref(storageUrl + file.name);
console.warn(file); // Watch Screenshot
var uploadTask = storageRef.put(file);
答案 0 :(得分:18)
尝试将文件转换为blob ...
<input type="text" id="text"><br><br>
<a href="#" id="autoclick">
<input type="button" value="type ok">
</a>