March 2019
Beginner
490 pages
12h 40m
English
Now that we've created a bucket, we can upload and download some files. Writing a function for uploading a file is similar to creating a bucket. We check the documentation to see how to construct our HTTP Request, figure out what information should be collected at the command line, and then write the function.
We need to use an HTTP PUT again. We need the name of the bucket that we want to store the file in and the name that we want the file to be stored under in S3. The body of the request will contain the file data. At the command line, we'll collect the bucket name, the name we want the file to have in the S3 service, and the name of the local file to upload.
Note that we open the local file in binary mode. ...
Read now
Unlock full access