Reputation: 3822
I am using Google AppEngine. I am using the blobstore to upload files to Google Cloud Storage. (I can't upload to Cloud Storage directly because of request size restriction of AppEngine.)
I could upload to Google Cloud Storage. But I couldn't specify the folder to upload. So every file is being stored in the root folder.
Can anybody tell me how to upload to a specific folder?
I use the code from https://github.com/crhym3/java-blobstore-gcs-sample
Upvotes: 2
Views: 469
Reputation: 35951
It comes out that you can pass a "folder" name with a bucket name into .withGoogleStorageBucketName()
method, like:
UploadOptions uploadOptions = UploadOptions.Builder
.withGoogleStorageBucketName("bucket_name/folder_name");
Upvotes: 4