【发布时间】:2021-12-19 10:01:08
【问题描述】:
我正在使用 firebase 模拟器进行本地开发。
前端应用程序创建一个项目,其中一些文件上传到存储桶中的“tmp/”文件夹。
项目保存后,我需要将上传的文件移动到项目文件夹中。但是在做(云功能)时
const storage = new Storage();
// also tried:
// const storage = admin.storage();
const bucket = storage.bucket(DEFAULT_BUCKET);
const destRoot = `${project.id}/files`;
// `tmpFiles` is an array of file paths
const movedfiles = await Promise.all(
tmpFiles.map((file: string) =>
bucket
.file(`tmp/${file}`)
.move(`${destRoot}/${file}`)
.then((result) => result[0].publicUrl())
.catch(console.log)
)
);
我收到了这个错误
ApiError: file#copy failed with an error - Not Implemented
所以暂时无法移动存储文件?
【问题讨论】:
标签: firebase google-cloud-platform google-cloud-functions google-cloud-storage