How to move files using firebase storage?

Is there a way to move files using firebase.storage ()?

Example: user1 / public / image.jpg for user1 / private / image.jpg

+7
firebase firebase-storage
source share
2 answers

There is no way to move to another place; instead, you can download it and then put it in another link and delete the previous location.

+4
source share

Since Firebase storage is supported by Google Cloud Storage, you can use the GCS rewrite ( docs ) or gsutil mv ( docs ) gsutil mv .

In addition, the move ( docs ) example in the GCloud Node follows:

 var bucket = gcs.bucket('my-bucket'); var file = bucket.file('my-image.png'); var newLocation = 'gs://another-bucket/my-image-new.png'; file.move(newLocation, function(err, destinationFile, apiResponse) { // `my-bucket` no longer contains: // - "my-image.png" // // `another-bucket` now contains: // - "my-image-new.png" // `destinationFile` is an instance of a File object that refers to your // new file. }); 
+5
source share

All Articles