[英]Display file uploading progress with Google Cloud Storage
I have a web app which allows users to upload files to Google Cloud Storage on behalf of my web app. 我有一个网络应用程序,允许用户代表我的网络应用程序将文件上传到Google Cloud Storage。 I already implemented a simple feature successfully using an HTML POST Form, described here .
我已经实现了一个简单的功能成功地使用HTML POST的形式,描述在这里 。
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.
希望您的建议或相关参考。
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
. 我需要做的额外工作是使用
gsutil setcors my-bucket-cors.xml gs://my-bucket
配置CORS。
my-bucket-cors.xml contains: my-bucket-cors.xml包含:
<?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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.