Well, I have not done anything in .net or less in WCF related to AWS, but the basic thing is, first, to have obviously installed the AWS SDK for .Net, configure the access credentials to the bucket which is explained in link and use them later with the S3 client instance:
try {
/// crear la solicitud para subir el archivo
/// recibe 3 parámetros:
/// 1. BucketName: el nombre del bucket
/// 2. Key: el nombre del archivo, es como se quiere llamar, incluso con ruta relativa. Ejemplo: directorio/archivo.txt
/// 3. FilePath: ruta física del archivo a subir
PutObjectRequest request = new PutObjectRequest()
{
BucketName = bucketName,
Key = keyName,
FilePath = filePath
};
PutObjectResponse response = client.PutObject(request);
}
catch (AmazonS3Exception amazonS3Exception)
{
if (amazonS3Exception.ErrorCode != null &&
(amazonS3Exception.ErrorCode.Equals("InvalidAccessKeyId")
||
amazonS3Exception.ErrorCode.Equals("InvalidSecurity")))
{
Console.WriteLine("Check the provided AWS Credentials.");
Console.WriteLine("For service sign up go to http://aws.amazon.com/s3");
}
else
{
Console.WriteLine("Error occurred. Message:'{0}' when writing an object", amazonS3Exception.Message);
}
}
By the way, the size of the file does not matter much since you have a good connection, although obviously you should not have files of more than 50MB of Office (EMO) since opening them would be tortuous.