I'm working on Python Twilio app and using Amazon Polly to convert text to speech. As you may know, Twilio <play>
verb can play sound files only from url
. Now I can convert the text to speech audio with Amazon Polly and upload the audio file to S3 and let Twilio play it with public url.
But when I use boto3 to upload the mp3 files to S3, the content types are changed to binary/ octet-stream which is not supported by Twilio. I tried to use content-type parameter in boto3 but didn't work out. When I use tinys3
library, it works. However, I cannot upload the file to S3 subdirectory. Tinys3 can only upload to bucket. I googled but haven't seen any example about tinys3 uploading a file to S3 subdirectory.
So could you please help me out in either content type issue with boto3 or uploading a file to S3 subdirectory in a bucket with Tinys3?