Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

renaming files in Google Cloud Storage?

Can you rename files in Google Cloud Storage?

I am letting users upload photos, but I want to give them the ability to edit the photo, at least by changing the name they uploaded it with. I am using Javascript through Node.js.

Thanks!

like image 873
user3826544 Avatar asked Nov 23 '22 16:11

user3826544


1 Answers

This command:

gsutil mv gs://my_bucket/olddir gs://my_bucket/newdir

will do the job. If you have a large number of files you need to do a multi-processing move, so use this command:

gsutil -m mv gs://my_bucket/olddir gs://my_bucket/newdir

You can find this information in the docs.

like image 165
George Avatar answered Jan 29 '23 22:01

George