Uploading Files to S3 in Python Using Boto3

preview_player
Показать описание
This video demonstrates a method for adding files to your S3 bucket.

WORK WITH ME👇🏼

✅ Implement features and fix bugs in your app: Live, one-on-one screenshare

💻 Code written in video
Рекомендации по теме
Комментарии
Автор

An easy way to create the credentials file is to run "aws configure" anywhere. The command knows to create the credentials file in ~/.aws

JohnnyMetz
Автор

Keep them coming Anthony!!...it really is some solid content you are producing. Thank You!

JG-uwnd
Автор

It was really helpful for me thanks! I was seeking something like this for a long time but couldn't get it now finally I got that.
Really appreciated!

bilalahmad
Автор

Hi Buddy the video is really helpful. 1 quick question, will multiload be possible with the above process.

GharoaRannaghor
Автор

I have once used boto3 for amazon MWS. I have done the credentials part differently because I didn't want to keep credentials in a plain text file :)
Thanks for the S3 example with boto3 ;)

sinancetinkaya
Автор

Thanks for taking the time to make this, but I think the preface needs to be explained more. For instance I did not know Flask was a Python framework or what that even meant. Based on my search, and my limited knowledge of Python, I was looking to learn more about Boto3 as it is used by AWS. I didn't quite understand why we were using Flask, or why we needed to make a website to upload to S3 considering AWS site already allows this. If it was just as an example that is fine, just mention that straight away please. Further it wasn't clear at first that we were effectively running this "Flask app" to launch a web server, and then by default it listens on port 5000. There was just a lot of assumed knowledge here.

reliantoppo
Автор

Hi...how do I get the image back? I am trying to return it (like a send_file) to my api get but I can make a download_file call but I can't return the file (like in Postman). Any chance you have a quick snippet on that?

BrianOstrovsky
Автор

So...What if you are hosting a php program on a Linux server and that php needs to call a python script to upload these files? I know how to do it if I provide the api with the info, but how do you get it to create the credentials file that can be used in this case?

ajpieri
Автор

is it possible to upload files directly from URL to S3 instead of downloading it into local file system and again uploading to S3?

chakravarthykk
Автор

Thanks for making such a wonderful video. What If I want to upload multiple files at same time.

rohitsingh
Автор

Hi Anthony, As always thanks for all the good work. If you recall, in one of your paid courses, you showed how to upload content to a local directory in the root of the Flask App.

I am using Docker now and will like a situation where my users profile pics, when uploaded, are saved directly to the AWS Bucket.

This tutorial gives me some ideas, which i can adapt to save the image, but I will like to save the URL to the image in the database as you advised previously as best practice.

Will this function still be sufficient:

def validate_image(self, image):
if self.image.data:
self.image.data =

I'm not exactly sure how AWS works. It's a bit new to me. Any help will be appreciated. Thanks.

ikukuvision
Автор

Hey Anthony. Great video.
I have a small query regarding the 'Key' which refers to the name of the object. What should i be doing if i want to store multiple objects in S3. What is happening currently is everytime i upload something, it keeps overwritting the previously stored file under the given key name.
Basically i am trying to understand if there is any way to store multiple files under multiple different names

pranavraj
Автор

Can you also make a video about amazon elastic transcoder with flask and boto3

wilsonreuben
Автор

in the same manner, can you upload a folder as well instead of a file ?

geoa
Автор

How do we create an object in the s3 with a read permission? or make it public?

freshlybakedkamote
Автор

if put_object fails how to process errors with like status return? Would be nice to update to real life example...

mbanc
Автор

how to upload images? Images that i change on the front end and have blobs of?

slapme
Автор

But what if I want to save the file inside a folder?

hinalucas
Автор

Hello, I'm new to all this stuff, and I'm getting an error: AttributeError: module 'boto3' has no attribute 'resource'... any ideas?

GuataPeluda
Автор

I have 1 question how can I find the region of all the bucket in my account. Can you please share will be really helpful

IshaGuptacrazy