Can't upload file in AppSmith
Opened this issue · 2 comments
tengfei86 commented
- Browser Version:
- ali-oss 6.18:
- Mini Showcase Repository:
- Network Resoponse Header x-oss-request-id:
try {
// 获取上传的文件
const file = FilePicker.files[0];
const options = {
meta: { temp: "demo" },
mime: "json",
headers: { "Content-Type": "text/plain" },
};
// const blob = new Blob([bytes],{type: fileType});
var data = new Blob(['This is the sample data']);
// 将文件上传到阿里云OSS
const result = await client.put("debug.txt", data,options);
console.log("=========");
console.log(result);
// 显示上传成功的消息
showAlert('上传成功', 'success');
// 获取上传后的文件URL
const uploadedFileUrl = result.url;
console.log("Uploaded File URL:", uploadedFileUrl);
// 将上传的文件URL保存到变量
myvar1 = uploadedFileUrl;
// 返回文件URL,或者在需要的地方使用这个变量
return myvar1;
} catch (e) {
// 显示上传失败的消息
console.log("caceh" + e);
showAlert('上传失败: ' + e.message, 'error');
}
this log file is as below ,you can refer
47.94.208.160-1724898269844.log
tengfei86 commented
Any update ?
YunZZY commented
The provided code snippet does not reveal any apparent issues. However, based on the log information, the following problems may exist:
- The usage of the "Expect" request header
- The usage of Webworker, but this SDK does not support Webworker at present
If it is not due to the above reasons, please provide a minimal reproducible repository and steps to reproduce it so that we can check it out.