我正在尝试读取以上传从存储读取的文件到 firebase。将文件作为数组缓冲区读取时出现此错误
{"code": 2, message:"SECURITY_ERR"}
Run Code Online (Sandbox Code Playgroud)
这是代码
this.file.readAsArrayBuffer(dirPath,url.name).then((buffer)=>{
// this.upload(buffer,url.name);
let blob = new Blob([buffer],{type:'image/jpeg'})
alert(blob);
firebase.storage().ref('files/'+url.name).put(blob).then((d)=>{
alert(JSON.stringify(d));
}).catch(e=>{
alert(e);
})
}).catch(e=>{
alert(JSON.stringify(e));
})
Run Code Online (Sandbox Code Playgroud)
我还添加了所有这些权限 READ_EXTERNAL_STORAGE WRITE_EXTERNAL_STORAGE
我有这个curl命令
curl -X POST \
https://www.wellingtonsoccer.com/lib/api/auth.cfc?returnFormat=JSON&method=Authenticate' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'postman-token: b408a67d-5f78-54fc-2fb7-00f6e9cefbd1' \
-d '{"email":"myemail@xyz.com",
"user_password":"mypasss",
"token":"my token"}
Run Code Online (Sandbox Code Playgroud)
我想以与该curl请求相同的角度4发送http发布。