How to upload media (image, video) to Google Cloud Storage with Java

1 view
Skip to first unread message

peter T via StackOverflow

unread,
Nov 22, 2014, 2:26:28 PM11/22/14
to google-appengin...@googlegroups.com

I am now facing with a problem once uploading media files to Google Cloud Storage by using Google Cloud Storage API Java. To be more specific, the GCS API Java example just help us upload text files to Google Bucket but is not useful for media files. I also see some discussion from ticket: Written file not showing up in Google Cloud Storage that the team suggest to use a gsutil tool written by Python. I am not using blobstore as well

My question is how can I do with the following requirements: -Creating and deleting buckets. -Uploading, downloading, and deleting objects (such as media files). -Listing buckets and objects. -Moving, copying, and renaming objects.

by implementing with Java?

I thank you very much for your time and look forward to hearing from you.



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/27081464/how-to-upload-media-image-video-to-google-cloud-storage-with-java

Jose Montes de Oca via StackOverflow

unread,
Nov 24, 2014, 12:45:24 AM11/24/14
to google-appengin...@googlegroups.com
  • Upload/Download files: you can use the Blobstore API which can be configured to store blobs in Google Cloud Storage by specifying your bucket in the BlobstoreService createUploadUrl. Similarly, to download you can create a createGsBlobKey with the Bucket name + Object name which can then be served by the Blobstore service.
  • Create/Delete buckets: The Google Cloud Storage Java Client Library does not offers a way to create/delete buckets. You will need to use Google Cloud Storage REST API to programatically create and delete. Thought, you might want to consider organizing your data within one bucket.
  • Moving, copying, and renaming objects: make use of the Google Cloud Storage Java Client Library


Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/27081464/how-to-upload-media-image-video-to-google-cloud-storage-with-java/27098453#27098453
Reply all
Reply to author
Forward
0 new messages