I am trying to save uploads of user photos to Google Cloud Storage, but ran into call problems:
blobStoreService.createUploadUrl(...)
I need to keep track of which user ID is associated with the downloaded file. If the user ID is 1234, I need to save this as metadata in the Cloud Storage file.
I can add metadata when I create the cloud storage file directly:
GSFileOptionsBuilder optionsBuilder = new GSFileOptionsBuilder() .setBucket("myBucket") .setKey(key) // path... .addUserMetadata("userId", "1234");
But I really want to use GAE provided that BlobStoreService.createUploadUrl (...), because it supports files of a larger size than this code can handle. Is it possible to specify metadata at all using createUploadUrl? Or can you even find out which google storage key / name is created?
Update I already have blobKey from serlvet server callback. However, I cannot find a way to add metadata to the Google storage file associated with this blobKey. At least locally, he thinks this is a BlobStore entry, not a GS file
source share