Member-only story
File transfer app with Blazor: Integrating with S3
This article is part of the series on how to build a file transfer web application with Blazor and AWS. Read the whole series here!
Introduction
In the last tutorial, you learned how to integrate your application with different AWS services and deploy it to Elastic Beanstalk. Now, it’s time to take care of some of the core functionality: uploading and downloading files from S3.
Creating the bucket
In order to work with files in S3, we must first create a bucket — in a way, you can think of them as directories. You can use buckets for multiple purposes, such as hosting static websites, but we are only going to use a bucket for storing our files.
To create a bucket, search for the S3 service in the AWS Management Console, click the Create bucket button and name it ‘transferzor-files’; leave all other options as default:
Creating the S3 upload/download service
Now that we have a bucket, we can create a service class in our application that will be used to upload and download files from this bucket. First of all, let’s install the ‘AWSSDK.S3’ NuGet package:
And the ‘AWSSDK.Extensions.NETCore.Setup’, for injecting AWS services into our…