1024programmer Java Stream binary files to GoogleStorage using Tornado

Stream binary files to GoogleStorage using Tornado

I’m trying to stream a binary file from a client request to Google Cloud Storage through my server.

I am using the Tornado framework to stream the data from the request to the server and the Google Cloud Storage API to stream the file to the Google upload_from_file method.

I’m new to Tornado and I’m using the @stream_request_body decorator so I can get the data in the request from chunks and upload each chunk to Google.

I’m trying to open a file-like object that I can write each chunk to, while uploading the “file” itself to Google.

The problem is that I can’t upload the “file” to Google before I start writing the block.

Any assistance would be greatly appreciated.

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/772203

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索