Cara upload file ke Google Cloud Storage menggunakan Python3 Framework Sanic

Cara upload file ke Google Cloud Storage menggunakan Python3 Framework Sanic

from google.cloud import storage
storage_client = storage.Client.from_service_account_json('lokasiconfig/gcp.json')
bucket = storage_client.bucket('nama bucket')
uploaded_file = request.files.get('video')

blob = bucket.blob(uploaded_file.name)
blob.upload_from_string(
    uploaded_file.body,
    content_type=uploaded_file.type
)




Buat service account key disini https://console.cloud.google.com/apis/credentials/serviceaccountkey?_ga=2.79850583.1105598440.1580360724-494026665.1575883906

Subscribe to receive free email updates:

0 Response to "Cara upload file ke Google Cloud Storage menggunakan Python3 Framework Sanic"

Post a Comment

1. Berikan Komentar yang Relevan
2. Tidak Mengandung SARA
3. Berkomentar yang Sopan

Konsultasi Aplikasi