1
我已將我的App-Engine從BlobStorage轉移到雲存儲。這工作FINDE這些上傳碼:從Blob傳輸到雲存儲
Upload.py:
...
upload_url = blobstore.create_upload_url('/upload', gs_bucket_name="my-default-bucket")
...
my_upload_template.html:
...
<form action="{{ upload_url }}" method="POST" enctype="multipart/form-data">
<input type="file" name="file">
<input type="submit" name="submit" value="Submit">
</form>
...
Upload.py:
class UploadBlobHandler(blobstore_handlers.BlobstoreUploadHandler):
def post(self):
file_info = self.get_file_infos()[0]
self.response.out.write(file_info.gs_object_name)
self.redirect("/download/serve" + file_info.gs_object_name)
它的工作很大。但它不僅在Google Cloud Storage-Bucket中上傳。它也上傳到了Blob存儲中。 (可以檢查你何時去https://appengine.google.com
並點擊Blob Viewer。)
這是正確的嗎?這樣對嗎?或者我有什麼問題?