I use amazon.NET SDK in widows phone 8 application to upload images, the code worked fine. Now i get an exception
The bucket you are trying to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.
I updated to the latest SDK 2.0.2.2, has anything changed with the update?
My code
string awsID = "myid"; string secretKey = "mysecretkey"; try{ AmazonS3Client s3Client = new AmazonS3Client(awsID, secretKey,RegionEndpoint.USWest1); string s=""; if (IsolatedStorageSettings.ApplicationSettings.Contains("selectedphoto1")) { s = IsolatedStorageSettings.ApplicationSettings["selectedphoto1"] as string; } var InputStream = App.GetResourceStream(new Uri("appname;component/Assets /call.png", UriKind.Relative)); var request = new PutObjectRequest() { BucketName = "mybucketname", ContentType="image/png", Key=s+".jpg", InputStream = myFileStream, }; await s3Client.PutObjectAsync(request); } catch (Exception ex) { Console.Write(ex.InnerException); }
source share