Creating folder in bucket google cloud storage using php

前端 未结 3 1471
日久生厌
日久生厌 2021-01-13 09:52

I am very new to the google cloud storage.

I want to create folder in bucket using php coding. I have searched a quite few sites and on 1 i saw it was written:

3条回答
  •  孤城傲影
    2021-01-13 10:29

    You probably don't actually need to create a folder.

    Google Storage isn't a tree structure like your operating system's filesystem uses, all Objects are stored in buckets at the top level. However you can give an Object a name with slashes in it, so it will kind of look like it is in a folder - Users/username/docs/2012/09/21/activity.csv is a perfectly good name for an Object and doesn't need any supporting folders.

    Once you've got Objects with this sort of scheme in place, you can list them as if you were viewing the contents of a folder with the delimiter and prefix parameters as per these docs.

    So if you only wanted to create myfoldertrial so you could upload example.png into it, there's no need to create the folder, you can just upload straight to myfoldertrial/example.png.

提交回复
热议问题