Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. var accessKey = Config.GetValue("AWSAccessKey");
  2. var secretKey = Config.GetValue("AWSSecretKey");
  3. using (var client = new AmazonS3Client(accessKey, secretKey, config))
  4. {
  5. var request = new PutObjectRequest();
  6. request.BucketName = Config.GetValue("PublicBucket");
  7. request.Key = newFileName;
  8. request.InputStream = resizedImage;
  9. request.AutoCloseStream = false;
  10. using (var uploadTaskResult = client.PutObject(request))
  11. {
  12. using (var uploadStream = uploadTaskResult.ResponseStream)
  13. {
  14. uploadStream.Seek(0, SeekOrigin.Begin);
  15. var resultStr = new StreamReader(uploadStream).ReadToEnd();
  16. }
  17. }
  18. }
  19.  
  20. Fatal unhandled exception in Web API component: System.Net.WebException: The remote name could not be resolved: 'images.ourcompany.com.http'
  21. at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
  22. at System.Net.HttpWebRequest.GetRequestStream()
  23. at Amazon.S3.AmazonS3Client.getRequestStreamCallback[T](IAsyncResult result)
  24. at Amazon.S3.AmazonS3Client.endOperation[T](IAsyncResult result)
  25. at Amazon.S3.AmazonS3Client.EndPutObject(IAsyncResult asyncResult)
  26. at Tracks.Application.Services.Bp.BpTemplateService.UploadImage(Byte[] image, String fileName) in ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement