title: Upload to S3 return Forbidden
body: <p>I have a form to upload file to my bucket in aws S3 and this is the form</p>
  
  <pre><code>&lt;form action="/user/fileUpload" enctype="multipart/form-data" class="ui form" method="post"&gt;
  
    &lt;div class="field"&gt;
      &lt;select class="ui dropdown"&gt;
        &lt;option value=""&gt;Print Agency&lt;/option&gt;
        &lt;option value="fastprint"&gt;Fast Print&lt;/option&gt;
        &lt;option value="printpress"&gt;Print Press&lt;/option&gt;
      &lt;/select&gt;
    &lt;/div&gt;
  
    &lt;div class="field"&gt;
      &lt;input type="file" name="uploadFile" /&gt;
    &lt;/div&gt;
  
    &lt;div class="field"&gt;
      &lt;input type="submit" value="Upload" class="ui blue submit button" /&gt;
    &lt;/div&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>and this is the action that will active if I press the submit button</p>
  
  <pre><code>fileUpload: function(req, res) {
  req.file('uploadFile').upload({
    adapter: require('skipper-s3'),
    key: 'THE-KEY',
    secret: 'THE-SECRET',
    bucket: 'THE-BUCKET'
  }, function (err, filesUploaded) {
    if (err) {
      console.log(err);
      return res.negotiate(err);
    }
    return res.ok({
      files: filesUploaded,
      textParams: req.params.all()
    });
  });}
  </code></pre>
  
  <p>This is my S3 CORS Configuration</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"&gt;
      &lt;CORSRule&gt;
          &lt;AllowedOrigin&gt;*&lt;/AllowedOrigin&gt;
          &lt;AllowedMethod&gt;GET&lt;/AllowedMethod&gt;
          &lt;AllowedMethod&gt;PUT&lt;/AllowedMethod&gt;
          &lt;AllowedMethod&gt;POST&lt;/AllowedMethod&gt;
          &lt;AllowedMethod&gt;DELETE&lt;/AllowedMethod&gt;
          &lt;MaxAgeSeconds&gt;3000&lt;/MaxAgeSeconds&gt;
          &lt;AllowedHeader&gt;*&lt;/AllowedHeader&gt;
      &lt;/CORSRule&gt;
  &lt;/CORSConfiguration&gt;
  </code></pre>
  
  <p>And This is my S3 Bucket Policy</p>
  
  <pre><code>{
      "Version": "2012-10-17",
      "Id": "Policy1433335661532",
      "Statement": [
          {
              "Sid": "Stmt1433335656754",
              "Effect": "Allow",
              "Principal": "*",
              "Action": [
                  "s3:DeleteObject",
                  "s3:GetObject",
                  "s3:PutObject"
              ],
              "Resource": [
                  "arn:aws:s3:::BUCKET-NAME/*",
                  "arn:aws:s3:::BUCKET-NAME"
              ]
          }
      ]
  }
  </code></pre>
  
  <p>but always result forbidden. I don't know why.
  result image: </p>
  
  <p><img src="https://i.stack.imgur.com/gUcWN.png" alt="http://imgur.com/MMtingu."></p>
  
  <p>And I really need your help here.</p>
  
  <p><strong>UPDATE WITH ANSWER</strong></p>
  
  <p>After thinking about @tom answer I found out how stupid I am after I know all of this because I forgot to put few line.</p>
  
  <p>I should put this line inside routes.js</p>
  
  <pre><code>'post /user/fileUpload': {
  controller: 'UserController',
  action: 'fileUpload'},
  </code></pre>
  
  <p>And this line below the submit button because I use CSRF</p>
  
  <pre><code>&lt;input type="hidden" name="_csrf" value="&lt;%= _csrf %&gt;" /&gt;
  </code></pre>
  
  <p>And this line inside UserController action fileUpload, bellow 'bucket'</p>
  
  <pre><code>ACL: 'public-read'
  </code></pre>
  
  <p>Regards,</p>
  
  <p>Elmer</p>