Writing to a file on an Amazon s3 bucket using C #

I have a text file in my amazon s3 bucket and I want to write text at the end of this file. Something like the following: xxxxxx | xxxxxx | xxxxx | xxxx. I want to do this using C #. I tried using a streamwriter but it did not work.

using(StreamWriter writer = new StreamWriter(Server.MapPath(url), true)) { writer.WriteLine("xxxxxxxx|xxxxxxxxxxx|xxxxxxx|xxxxxxxxxx"); } 

My initial hunch is that there must be some kind of authentication requirement. Can someone help me or direct relevant resources.

+4
source share
1 answer

Amazon S3 does not support adding objects. You will need to read the entire object from S3, and then return it back with the new data.

The AWS SDK for .NET (see http://aws.amazon.com/sdkfornet ) provides tools that simplify the management of authenticated S3 operations in C #, including handling S3 codes such as local file systems (see http: // docs.amazonwebservices.com/sdkfornet/latest/apidocs/html/N_Amazon_S3_IO.htm )

+9
source

Source: https://habr.com/ru/post/1443719/


All Articles