简体   繁体   中英

How to upload to google cloud storage an image using Python, without saving the image on my local disk?

storage_client = storage.Client.from_service_account_json('service-account-file.json') bucket = storage_client.get_bucket(my_bucket) blob = bucket.blob(my_blob) blob.upload_from_string(img)

It depends from where you are uploading the image or in better explanation from where you store the image... if you wan to get the image from specific link from the web you can scrape using python module selinium or scrapy depends from where you do ... if you want upload using code you might more read the documentation and use the api key to upload ..

I see your code you may need to use scrapy instead of javascript ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM