Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upload images/video to google cloud storage using Google App Engine

I have read the question from Sending images to google cloud storage using google app engine.

However, the codes in the answer that the file will upload to Blobstore first, so the file can not be exceeded 32MB.

How can I upload the large file to Google Cloud Storage directly?

I have checked the official document Upload Objects, but I still don't know how to write a form to post a large file.

like image 623
Jerry Avatar asked Dec 09 '22 23:12

Jerry


2 Answers

easy since 1.7.0

upload_url = blobstore.create_upload_url('/upload_handler', gs_bucket_name='my_bucket')

Will upload straight to Google Storage and return you blob keys that point to the uploads in Cloud Storage.

like image 196
Stuart Langley Avatar answered Feb 16 '23 00:02

Stuart Langley


upload_url = blobstore.create_upload_url('/upload', gs_bucket_name='mybucketname')

does get the upload with the blob key to the cloud storage but it still puts the uploaded file in the blobstore as well.

like image 45
Jay Avatar answered Feb 16 '23 00:02

Jay