public AmazonS3UploadConfiguration(AmazonCredentials credentials, string bucket, AmazonS3ObjectConfiguration objectConfiguration, TimeSpan policyExpiration)
 {
     _credentials         = credentials;
     _bucket              = bucket;
     _objectConfiguration = objectConfiguration;
     _policyExpiration    = policyExpiration;
 }
 public AmazonS3UploadConfiguration(AmazonCredentials credentials, string bucket, AmazonS3ObjectConfiguration objectConfiguration, TimeSpan policyExpiration)
 {
     _credentials = credentials;
     _bucket = bucket;
     _objectConfiguration = objectConfiguration;
     _policyExpiration = policyExpiration;
 }
 public AmazonS3UploadConfiguration(AmazonCredentials credentials, string bucket, AmazonS3ObjectConfiguration objectConfiguration)
     : this(credentials, bucket, objectConfiguration, TimeSpan.FromMinutes(20))
 {
 }
 public AmazonS3UrlSigner(AmazonCredentials credentials)
 {
     _credentials = credentials;
 }
        public virtual ActionResult Logo()
        {
            var randomStringGenerator = new RandomStringGenerator();
            var objectKey = string.Format("uploads/{0}/${{filename}}", randomStringGenerator.GenerateString(16));
            var bucket = "wnuh";

            var maxFileSize = 512 * 1024 * 1024;
            var objectConfiguration = new AmazonS3ObjectConfiguration(objectKey, AmazonS3CannedAcl.Private, maxFileSize);

            var credentials = new AmazonCredentials(
                            ConfigurationManager.AppSettings.Get("amazon.access_key_id"),
                            ConfigurationManager.AppSettings.Get("amazon.secret_access_key"));

            var uploadConfiguration = new AmazonS3UploadConfiguration(credentials, bucket, objectConfiguration);

            var viewModel = new OrganizationVm { Configuration = uploadConfiguration };

            return PartialView(viewModel);
        }
Beispiel #6
0
 public AmazonS3UrlSigner(AmazonCredentials credentials)
 {
     _credentials = credentials;
 }
 public AmazonS3UploadConfiguration(AmazonCredentials credentials, string bucket, AmazonS3ObjectConfiguration objectConfiguration)
     : this(credentials, bucket, objectConfiguration, TimeSpan.FromMinutes(20))
 {
 }