Use a different libcloud function for uploading files
This commit is contained in:
parent
82d7f09382
commit
3f676be66c
1 changed files with 5 additions and 6 deletions
|
@ -27,13 +27,12 @@ class CloudStorageUploader:
|
||||||
extra = {'meta_data': {'filename': file_base_name},
|
extra = {'meta_data': {'filename': file_base_name},
|
||||||
'acl': 'public-read-write'}
|
'acl': 'public-read-write'}
|
||||||
|
|
||||||
with open(audio_file_path, 'rb') as iterator:
|
obj = driver.upload_object(file_path=audio_file_path,
|
||||||
obj = driver.upload_object_via_stream(iterator=iterator,
|
|
||||||
container=container,
|
container=container,
|
||||||
object_name=object_name,
|
object_name=object_name,
|
||||||
|
verify_hash=False,
|
||||||
extra=extra)
|
extra=extra)
|
||||||
|
|
||||||
|
|
||||||
metadata["filesize"] = os.path.getsize(audio_file_path)
|
metadata["filesize"] = os.path.getsize(audio_file_path)
|
||||||
|
|
||||||
'''remove file from organize directory'''
|
'''remove file from organize directory'''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue