Skip to content

Instantly share code, notes, and snippets.

@liangchaoboy
liangchaoboy / gist:53debed20204a1da0b9674f23dcf65a5
Created October 16, 2019 14:33 — forked from Dillie-O/gist:2480125
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);