0

How to upload files from the Web server to s3 bucket in .NET? Web server has read and write access to the bucket hence no AWS key is needed.

I have previously used S3 SDK and Access Key to upload, how do I handle connection to s3 bucket in current scenario ? Does S3 SDK facilitates this ?

Would to be grateful to get some information or resouces to follow.

Thanks in advance.

ryan
  • 81
  • 8
  • A simple google search for "upload to s3 from .net" brings you to this article: https://docs.aws.amazon.com/AmazonS3/latest/dev/HLuploadFileDotNet.html – Jack Marchetti Apr 24 '19 at 00:07
  • Hi @Jack thank you, i will check the Article.I am new to web development and s3 and may be I complicated thinkin. I was more thinking on how does authentication work while connecting to s3 bucket without providing any key .I will follow SDK documents to see if it has explanation. – ryan Apr 24 '19 at 00:25
  • Gotcha, well assuming your web server is an EC2 instance, you can use IAM to give your EC2 instances access to S3 and therefore you don't need to use access keys. – Jack Marchetti Apr 24 '19 at 01:19
  • Try this as well: https://stackoverflow.com/questions/34057679/aws-s3-bucket-access-from-ec2 – Jack Marchetti Apr 24 '19 at 01:20
  • That makes sense now about authentication, I will update how it goes.Thank you so much. – ryan Apr 24 '19 at 03:11

1 Answers1

0

Are you asking how to instantiate an Amazon.AWSClientFactory.CreateAmazonS3Client without providing an access key or a secret key? You can pass the constructor nulls. For example:

var client = Amazon.AWSClientFactory.CreateAmazonS3Client(null, null, s3Config)
David Klinge
  • 362
  • 1
  • 9
  • Yes instantiate the S3 client and perform upload without providing an access key or a secret key. I will follow your suggestion and update the status.Thanks your for prompt reply – ryan Apr 24 '19 at 00:15