S3 - Upload Objects

Once a bucket has been created, objects can be uploaded to the bucket using the AWS console and also programmatically. Folders can alo be created and objects can be uploaded to the folders as well.

It is important to note that S3 does not actually have the concept of the folders or file names, instead it has the concept of the key names or key that identifies the objects using the file names or folder-file name combination. S3 does not have hierarchy of folders and files, just the objects.

The object key names consists of UTF-8 character encoding and can be 1024 bytes long. The key names can be alpha-numeric including upper and lowercase characters and can contain certain special characters - !, -, _, ., *, ', (, ). The following are all valid key names.

  • abc123.pdf
  • ABC123.pdf
  • developer/abc123.pdf
  • developer/files/abc-789.pdf

The above are all valid key names. Note that the keys are case sensitive, that is abc.pdf is different than ABC.pdf. S3 does not have the concept of folders but when objects are uploaded with "/" in the keys, the AWS S3 console automatically displays a heirarchy of folders. In the example - developer/files/abc-789.pdf - a folder structure developer/files/ is displayed on the screen.

To upload a file via the console, simply click on the bucket name as shown below.

Then there are two options, a folder can be created by clicking on "create folder" or files can be uploaded using the "Upload" button. To create a folder, click on create folder.

Once the bucket is created, objects can be uploaded the folder or to the bucket.

The bucket upload option contains to set properties of the objects like the storage class, permission, encryption and meta data. Also, this additional steps and the objects can be uploaded using the "Upload" button on left-bottom.

Interesting to note that the size of a individual folder can be obtained by clicking on More > Get size. This could be helpful when large number of objects are stored in a folder.