0
我有一個Python腳本,嘗試上載的谷歌存儲的文件,但繼續出現此錯誤:上傳.RAW文件到谷歌雲存儲
googleapiclient.errors.UnknownFileType:
這裏是我的代碼:
def create_service():
credentials = GoogleCredentials.get_application_default()
return build('storage', 'v1', credentials=credentials)
service=create_service()
request=service.objects().insert(bucket='testBucket',name='test.raw',media_body=path_files+file_raw)
response=request.execute()
exit()
file_raw
是一個音頻.raw文件。
我使用的庫是:
from oauth2client.client import GoogleCredentials
from googleapiclient.discovery import build
from google.cloud import storage
你好,你可以爲你的代碼添加一個更好的縮進,並指定哪些庫用於在谷歌存儲上上傳? –