I'm developing locally with firebase emulator.
The front app create a project with some files uploaded to a 'tmp/' folder in storage bucket.
I need to move the uploaded files to the project folder once the project is saved. But when doing (a cloud function)
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)
)
);
I got this error
ApiError: file#copy failed with an error - Not Implemented
So it's no possible to move storage files for now?