How to create an empty folder on Google Storage with Google API? (Assume that /
is path separator.)
Thank you for the Question and the chosen Best answer. Here is a code snippet that I wrote: Python Method:
def create_folder(bucket_name, destination_folder_name):
storage_client = storage.Client()
bucket = storage_client.get_bucket(bucket_name)
blob = bucket.blob(destination_folder_name)
blob.upload_from_string('')
print('Created {} .'.format(
destination_folder_name))
main code that calls the method:
folder = create_folder(bucket_name, 'test-folder/')