I want to upload a mp4 file from my pc to my google cloud bucket but i get an error [Errno 13] Permission denied: 'E:\\\\Coding\\\\Videos'
I Would be happy is anyone could help me with this problem. Here is the code btw
def upload_to_bucket(blob_name, file_path, bucket_name):
try:
bucket = yclient.get_bucket(bucket_name)
blob = bucket.blob(blob_name)
f = open('E:\Coding\Videos')
blob.upload_from_filename(file_path)
return True
except Exception as e:
print(e)
return False
file_path = r'E:\Coding\Videos'
upload_to_bucket('videot', os.path.join(file_path, videot), 'audios-for-pychromecast')
upload_to_bucket('videosfrocc/videot', os.path.join(file_path, videot), 'audios-for-pychromecast')```
It seems you're trying to open
a directory? That will probably not work, you'd have to go through all files manually. But you're also not then using the file handle that you opened, so you might want to get rid of that entirely.
What does upload_from_filename
look like? Is that from a library?
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.