Uploading and Downloading5:25 with David Baumgold
You've got an AWS account, and you've got an S3 bucket. Let's store and retrieve some files with S3!
You have made an AWS account. 0:00 You've made an S3 bucket. 0:02 Now, you can store files on S3 the way it's meant to be used. 0:04 You also should know that the more data you store in S3, and 0:07 the longer you store it there, the more it will cost. 0:10 However, if you created your AWS account less than a year ago, 0:13 you get free space on S3, thanks to the free tier. 0:16 So you can experiment without paying anything. 0:19 So, let's start experimenting. 0:22 We'll start by opening the bucket that we've created. 0:24 You can select a bucket by clicking on its row in the bucket list, but in this case, 0:26 we want to open it by clicking on the name of the bucket. 0:30 As you can see the bucket is empty, so 0:33 S3 is giving us some information on how to get started. 0:35 It's suggesting that we upload an object, set object properties, and 0:38 set object permissions. 0:42 S3 refers to anything you can put into a bucket as an object, 0:44 whether that's a file, a folder, or any other data you want to upload. 0:47 We're going to upload and download objects, but 0:51 we won't worry about object properties or permissions just yet. 0:53 To upload a new file, you can either click on the Get started button at the bottom, 0:56 or on the Upload button at the top left. 1:00 Next, click on the Add Files button to select which files you want 1:03 to upload to the bucket. 1:06 You can select one file or several all at once. 1:08 I've got this handy image file right here. 1:11 Perfect, why don't we put this in my S3 bucket? 1:16 I'll just click on Add Files and select the image file from the desktop. 1:19 And now, S3 is ready to upload the file. 1:26 I could click on Add more files to add more files to this upload. 1:29 Or I could click on the Next button to configure some details about how 1:32 S3 should store these files. 1:35 But for now, let's just do the simple thing and click the Upload button. 1:37 You'll notice that S3 shows a progress bar for when files are uploaded, but 1:42 it completed almost instantly. 1:45 Looks like I'm on a really fast internet connection. 1:47 Now I can see the file in the bucket. 1:50 Just like with the bucket list we saw before, you can click on the row of 1:52 the file to select it, or I can click on the file name to open it. 1:54 Opening a file in a bucket isn't very exciting, but 2:00 you can see some information like the last activity date and the file size. 2:02 You can also click on the Download button to download a copy of the file. 2:06 Hey, looks exactly the same as the file I uploaded! 2:12 In order to go back to the list of files in the bucket, 2:15 you can click on the name of the bucket, above the filename. 2:17 You can also go back to the list of buckets by clicking on the Amazon S3 2:20 link next to that. 2:23 Let's go back into the bucket and create a folder so 2:25 that we can organize files in the bucket. 2:27 Just click on the Create Folder button then type in the name of your new folder 2:29 and click Save. 2:34 As you can see, you can put spaces and 2:37 special characters into your folder names if you want. 2:39 Just like with the file, you can click on the [INAUDIBLE] selected, and 2:43 click on the name to open it. 2:46 You can upload files and folders if you want to, it works exactly the same way. 2:47 But for now, let's go back up. 2:51 You can upload any kind of file you want into an S3 bucket, not just pictures. 2:53 I'm going to upload an audio file and a video file as well. 2:58 These are larger files so they take a little longer to upload to S3. 3:06 The progress bar tells me how close we are to being done. 3:09 Fortunately I am on a fast internet connection so it's still pretty fast. 3:12 If your on a slower connection you don't have to wait until it finishes, 3:16 you can still keep using S3 even while you're uploading files. 3:20 When you no longer need to keep a file on S3, you can delete it. 3:23 I don't think that I need that favorite pictures folder after all, 3:26 so I'll delete it. 3:29 First, select the file or files you want to delete like this. 3:30 Then click on the More button to find the Delete option. 3:34 Notice that there's an Undo delete option, but it's misleading. 3:37 You can't use it unless you've enabled versioning for 3:41 your S3 bucket which makes using S3 much more expensive. 3:43 That's another topic for another course. 3:47 So for now, pretend that the Undo delete option doesn't exist. 3:48 When you delete something from S3, it's gone and you can't get it back. 3:52 When you want to delete something from S3, it will show you this confirmation screen. 3:57 So that you can double-check that you're deleting exactly what you expect. 4:01 When you've double-checked, click the Delete button. 4:04 There are just a few other things you need to know about files on S3. 4:09 First of all, 4:13 there's no limit to the number of files you can store in one bucket. 4:14 You can toss in as many as you like, large or small. 4:17 And S3 will happily accept them all. 4:20 S3 can hold files up to 5 TB in size, so you probably don't need to 4:23 worry about uploading files that are too big for S3 to handle. 4:28 However, the second thing that you need to know is that you 4:32 can overwrite files in S3 by uploading a new file with the same name. 4:35 If you have a file in S3 with a certain name, and 4:41 you upload a new file with the same name to the same folder of the same bucket, 4:43 then the new file will overwrite the old file. 4:48 It won't warn you, so be aware. 4:51 Lastly, S3 will start calculating costs from the moment that you upload a file 4:54 until that file is deleted from S3. 4:59 S3 also charges based on how often the file is downloaded. 5:02 If you're the only one with access to the file, 5:05 you probably don't have to worry about that, but in the next video, 5:07 you'll learn how to make files on S3 publicly accessible if you want to. 5:11 Public files can be downloaded by anyone, any time, so be careful. 5:15 When you don't need data on S3 anymore delete it so 5:20 that you don't need to pay for it anymore. 5:23
You need to sign up for Treehouse in order to download course files.Sign up