1

I have a web app which allows users to upload files to Google Cloud Storage on behalf of my web app. I already implemented a simple feature successfully using an HTML POST Form, described here.

While a user uploads a file, I would like to display information such as remaining percentage of file uploading, transferring rate, and so on. I find nowhere in the documentation that explains this topic, and have no idea how to start with. Would appreciate your suggestion or relevant references.

Community
  • 1
  • 1
Nimit Pattanasri
  • 1,602
  • 1
  • 26
  • 37
  • Might want to check the solution I just came up with http://stackoverflow.com/questions/30562391/track-progress-of-file-upload-to-google-cloud-storage-via-js/30635818#30635818, if your still working on/maintaining this app. – camelCaseD Jun 04 '15 at 05:48

1 Answers1

2

I found a really simple solution which works great for me :)

An extra work I need is to configure CORS with gsutil setcors my-bucket-cors.xml gs://my-bucket.

my-bucket-cors.xml contains:

<?xml version="1.0" encoding="UTF-8"?>
<CorsConfig>
    <Cors>
        <Origins>
            <Origin>http://my-web-app.com</Origin>
        </Origins>
        <Methods>
            <Method>GET</Method>
            <Method>HEAD</Method>
            <Method>POST</Method>
            <Method>DELETE</Method>
            <Method>PUT</Method>
        </Methods>
        <ResponseHeaders>
            <ResponseHeader>*</ResponseHeader>
        </ResponseHeaders>
        <MaxAgeSec>1800</MaxAgeSec>
    </Cors>
</CorsConfig>
Community
  • 1
  • 1
Nimit Pattanasri
  • 1,602
  • 1
  • 26
  • 37
  • 1
    Also check another [jQuery plugin](https://github.com/stevenbenner/jquery-xhr-upload-queue) which looks really promising, based on the same technology (XHR2, FileAPI, Drag&Drop). – Nimit Pattanasri May 15 '13 at 06:25