title: Amazon S3 .NET: Upload base64 image data?
body: <p>I am trying to convert images to base64, and trying to upload that to AWS S3 using C#. I keep getting a remote server not found exception. But I am able to log in programmatically and list the buckets I have.
  Can you please identify whats wrong.</p>
  
  <pre><code>    static void Main(string[] args)
      {
  
          string configaccess = ConfigurationManager.AppSettings["AWSAccesskey"];
          string configsecret = ConfigurationManager.AppSettings["AWSSecretkey"];
  
          var s3Client = new AmazonS3Client(
              configaccess,
              configsecret,
              RegionEndpoint.USEast1
          );
  
          Byte[] bArray = File.ReadAllBytes("path/foo.jpg");
          String base64String = Convert.ToBase64String(bArray);
  
          try
          {
              byte[] bytes = Convert.FromBase64String(base64String);
  
              using (s3Client)
              {
                  var request = new PutObjectRequest
                  {
                      BucketName = "bucketName",
                      CannedACL = S3CannedACL.PublicRead,
                      Key = string.Format("bucketName/{0}", "foo.jpg")
                  };
                  using (var ms = new MemoryStream(bytes))
                  {
                      request.InputStream = ms;
                      s3Client.PutObject(request);
                  }
              }
          }
          catch (Exception ex)
          {
              Console.WriteLine("AWS Fail");
          }
  
      }
  </code></pre>