I want to load an audio file via the PutObjectAsync()
method but after a while this exception is thrown:
ex = {"Your socket connection to the server was not read from or written to within the timeout period."}
For a .txt file this method works very well but once I load a file other than .txt the exception is thrown.
- size of my txt file: 2MB (works)
- size of my mp3 file: 700Ko (does not work)
My code:
using(var inputStream = new MemoryStream())
{
await request.File.CopyToAsync(inputStream);
var putObjectRequest = new PutObjectRequest(){
BucketName = "<my_bucket_name>",
Key = "<file_key>",
InputStream = inputStream,
};
await s3Client.PutObjectAsync(putObjectRequest);
}
I am using:
- .NET 6
- AWSSDK.S3: Version="3.7.9.42"
can someone help me please?