- Newest
- Most votes
- Most comments
I think the issue is that you're passing the entire get_recording
object to upload_fileobj
where you should be passing the data. Perhaps the final line should be s3.upload_fileobj(get_recording.data, bucket, upload_download_key)
?
Also: Where you're creating the s3
object you don't need to specify the access and secret keys if the Lambda function has the appropriate IAM role attached to it. You can just do s3 = boto3.client('s3')
which is much simpler and means you don't have to set up the credentials yourself.
Thank you so much for your thoughtful answer @Brettski@AWS! It really helped me figure out the issue. I am a newbie to working with s3 and you've made the development experience amazing. That side, it turns out that the script was uploading as expected. I just needed to add the .mp4 file extension to the filename. Here is the snippet I used in my testing in the terminal:
zoom_access_token = " Your_Token"
download_url = "Your_download_URL"
new_download_url = download_url +'?access_token=' + zoom_access_token
bucket = 'Yourbucket00' #your s3 bucket
upload_download_key = 'folder/folder.mp4' #your desired s3 path or filename
s3=boto3.client('s3',aws_access_key_id=y_access_key, aws_secret_access_key=y_secret_key)
http=urllib3.PoolManager(cert_reqs='CERT_REQUIRED',ca_certs=certifi.where())
get_recording = http.request('GET', new_download_url,preload_content=False)
s3.upload_fileobj(get_recording, bucket, upload_download_key)
Relevant content
- Accepted Answerasked 10 days ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated a year ago