Error 403 while uploading aws S3 . net

Asked

Viewed 102 times

0

Just Set up user permissions on S3 and everything worked perfectly!

I’m building a function to upload images in the S3 service from Amazon but I’m having a 403 error, there is some additional configuration I should do in my S3?

            TransferUtility fileTransferUtility = new TransferUtility(code, keyCode, Amazon.RegionEndpoint.USWest2);

            var uploadRequest = new Amazon.S3.Transfer.TransferUtilityUploadRequest();

            string filename = File.FileName;

            uploadRequest.InputStream = File.InputStream;
            uploadRequest.BucketName = "kasne";
            uploadRequest.Key = filename;
            uploadRequest.StorageClass = Amazon.S3.S3StorageClass.ReducedRedundancy;
            uploadRequest.CannedACL = Amazon.S3.S3CannedACL.PublicRead;

            //faz o upload.
            fileTransferUtility.Upload(uploadRequest);

            return filename;
  • 2

    In general error 403 refers to permission to perform certain actions, check some possibilities... Maybe your Firewall is blocking the application, or the Proxy, or permissions of your user on the server, anyway, something to do with privileges and permissions.

  • Thanks, I managed to upload and also download. It was missing to give permissions on the user I have in S3! Just add the permissions and the method I created worked perfectly! Thanks for the help!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.