Upload .mp3 file in Google Cloud Storage using Java client JSON API.

1,388 views
Skip to first unread message

Uttam Agarwal

unread,
Sep 25, 2015, 8:06:02 AM9/25/15
to Google App Engine
Hi

Is it possible to upload a mp3 file (audio file) in Google Cloud Storage  using Java client library.

I can access my bucket from Cloud Storage and can read the content of my bucket using Java client library JSON API.

But i want to upload a mp3 file in my bucket in cloud storage using Java client library JSON API.

Is it possible ?

Les Vogel

unread,
Sep 25, 2015, 9:35:38 AM9/25/15
to google-a...@googlegroups.com
I've uploaded files using the Java client library JSON API to GCS.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/fc57023a-4feb-4e89-a7a8-25217ef30bea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Les Vogel | Cloud Developer Relations | le...@google.com | 408-676-7023

Uttam Agarwal

unread,
Sep 25, 2015, 10:09:14 AM9/25/15
to Google App Engine

Thanks Les for reply.

I found a link (https://cloud.google.com/storage/docs/json_api/v1/json-api-java-samples) where it shows how to upload file in my bucket in Google Cloud Storage.

But problem is in this example they show how to upload txt file (content-type=text/plain) in bucket.

I found that for mp3 file, content type is audio/mpeg. But i can't understand how i read mp3 file for InputStreamContent ?
Can you please give me a soultion?


Thanks

Uttam

Ryan (Cloud Platform Support)

unread,
Sep 25, 2015, 10:45:40 AM9/25/15
to Google App Engine
Salutations Uttam,

Without knowing more about what you are trying to do high level and what errors you have it is difficult to help. From what I understand you need:

- The example you linked you can set the content type for the uploadStream
Reply all
Reply to author
Forward
0 new messages