title: AWS S3 JavaScript SDK - NetworkingError: Network Failure
body: <p>I am trying to use the examples provided by AWS in their Examples in the Browser webpage, and I keep receiving the <code>NetworkingError: Network Failure</code> error. Here is what I am using:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="https://sdk.amazonaws.com/js/aws-sdk-2.0.0-rc11.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
    // See the Configuring section to configure credentials in the SDK
  
    AWS.config.update({accessKeyId: '####', secretAccessKey: '####', region: 'us-east-1'});
    // Configure your region
  //  AWS.config.region = '';
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;input type="file" id="file-chooser" /&gt;
  &lt;button id="upload-button"&gt;Upload to S3&lt;/button&gt;
  &lt;div id="results"&gt;&lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
    var bucket = new AWS.S3({params: {Bucket: 'BUCKETNAMEGOESHERE'}});
  
    var fileChooser = document.getElementById('file-chooser');
    var button = document.getElementById('upload-button');
    var results = document.getElementById('results');
    button.addEventListener('click', function() {
      var file = fileChooser.files[0];
      if (file) {
        results.innerHTML = '';
  
        var params = {Key: file.name, ContentType: file.type, Body: file};
        bucket.putObject(params, function (err, data) {
          results.innerHTML = err ? err : 'UPLOADED.';
        });
      } else {
        results.innerHTML = 'Nothing to upload.';
      }
    }, false);
  &lt;/script&gt;
  
  &lt;div id="status"&gt;&lt;/div&gt;
  &lt;ul id="objects"&gt;&lt;/ul&gt;
  
  &lt;script type="text/javascript"&gt;
    var bucket = new AWS.S3({params: {Bucket: 'BUCKETNAMEGOESHERE'}});
    bucket.listObjects(function (err, data) {
      if (err) {
        document.getElementById('status').innerHTML =
          'Could not load objects from S3';
      } else {
        document.getElementById('status').innerHTML =
          'Could not load objects from S3';
      } else {
        document.getElementById('status').innerHTML =
          'Loaded ' + data.Contents.length + ' items from S3';
        for (var i = 0; i &lt; data.Contents.length; i++) {
          document.getElementById('objects').innerHTML +=
            '&lt;li&gt;' + data.Contents[i].Key + '&lt;/li&gt;';
        }
      }
    });
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My bucket is in the US Standard region, and I am trouble figuring out whether it uses <code>us-west-2</code> or <code>us-east-1</code>. When I go to my bucket's console, the URL is <code>https://console.aws.amazon.com/s3/home?region=us-west-2</code> yet someone mentioned on here that US Standard is <code>us-east-1</code>.</p>