Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var accessKey = Config.GetValue("AWSAccessKey");
- var secretKey = Config.GetValue("AWSSecretKey");
- using (var client = new AmazonS3Client(accessKey, secretKey, config))
- {
- var request = new PutObjectRequest();
- request.BucketName = Config.GetValue("PublicBucket");
- request.Key = newFileName;
- request.InputStream = resizedImage;
- request.AutoCloseStream = false;
- using (var uploadTaskResult = client.PutObject(request))
- {
- using (var uploadStream = uploadTaskResult.ResponseStream)
- {
- uploadStream.Seek(0, SeekOrigin.Begin);
- var resultStr = new StreamReader(uploadStream).ReadToEnd();
- }
- }
- }
- Fatal unhandled exception in Web API component: System.Net.WebException: The remote name could not be resolved: 'images.ourcompany.com.http'
- at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
- at System.Net.HttpWebRequest.GetRequestStream()
- at Amazon.S3.AmazonS3Client.getRequestStreamCallback[T](IAsyncResult result)
- at Amazon.S3.AmazonS3Client.endOperation[T](IAsyncResult result)
- at Amazon.S3.AmazonS3Client.EndPutObject(IAsyncResult asyncResult)
- at Tracks.Application.Services.Bp.BpTemplateService.UploadImage(Byte[] image, String fileName) in ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement