Skip to content

Instantly share code, notes, and snippets.

@Dillie-O
Dillie-O / gist:2480125
Created April 24, 2012 14:32
Amazon S3 Download File with Prompt
public static void DownloadObject(string keyName)
{
string[] keySplit = keyName.Split('/');
string fileName = keySplit[keySplit.Length - 1];
string dest = Path.Combine(HttpRuntime.CodegenDir, fileName);
using (client = Amazon.AWSClientFactory.CreateAmazonS3Client())
{
GetObjectRequest request = new GetObjectRequest().WithBucketName(bucketName).WithKey(keyName);