1
votes

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.

1
Might want to check the solution I just came up with stackoverflow.com/questions/30562391/…, if your still working on/maintaining this app.camelCaseD

1 Answers

1
votes

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>