AWS file upload with loopback: Failed to create a multipart upload on S3
<p>Trying to upload multiple image files to <code>AWS</code> using <code>loopback-component-storage</code></p>

<p>Here are the methods :</p>

<pre><code> Game.add = function(ctx,options,cb)
        {
               var status = ctx.req.query.status,
                defaultLangCode = ctx.req.query.defaultLangCode,
                nameEn = ctx.req.query.nameEn;

            var rec = new Object();
            rec.parentHouseId = houseId;
            rec.status = status;
            rec.defaultLangCode = defaultLangCode;
            rec.nameEn = nameEn;

            if(!options) options = {forceIframeTransport : true};
            ctx.req.params.container = 'common';
            Game.app.models.container.upload(ctx.req,ctx.result,options,function (err,fileObj) {
                if(err) {
                    cb(err);
                } else {
                    var fileInfo = fileObj.files.file[0];
                    console.log(fileInfo);
                }
            });
        };
</code></pre>

<p>AND</p>

<pre><code>Game.remoteMethod(
        'add',
        {
            http:{path: '/add', verb: 'post', status: 200, errorStatus: 400},
            accepts: [
                { arg: 'ctx', type: 'object', http: { source:'context' } },
                { arg: 'options', type: 'object', http:{ source: 'query'} }
            ],
            returns: {
                arg: 'fileObject', type: 'object', root: true
            }
        }
    );
</code></pre>

<p>I am trying to upload two image files there. Posting data/image produces this error twice:</p>

<blockquote>
  <p>Failed to create a multipart upload on S3: {"message":"Access
  Denied","stack":"AccessDenied: Access Denied\n    at
  Request.extractError
  (/vagrant/node_modules/aws-sdk/lib/services/s3.js:538:35)\n    at
  Request.callListeners
  (/vagrant/node_modules/aws-sdk/lib/sequential_executor.js:105:20)\n<br>
  at Request.emit
  (/vagrant/node_modules/aws-sdk/lib/sequential_executor.js:77:10)\n<br>
  at Request.emit
  (/vagrant/node_modules/aws-sdk/lib/request.js:668:14)\n    at
  Request.transition
  (/vagrant/node_modules/aws-sdk/lib/request.js:22:10)\n    at
  AcceptorStateMachine.runTo
  (/vagrant/node_modules/aws-sdk/lib/state_machine.js:14:12)\n    at
  /vagrant/node_modules/aws-sdk/lib/state_machine.js:26:10\n    at
  Request.
  (/vagrant/node_modules/aws-sdk/lib/request.js:38:9)\n    at
  Request.
  (/vagrant/node_modules/aws-sdk/lib/request.js:670:12)\n    at
  Request.callListeners
  (/vagrant/node_modules/aws-sdk/lib/sequential_executor.js:115:18)","code":"AccessDenied","region":null,"time":"2016-08-24T19:43:28.415Z","requestId":"2802978376D53185","extendedRequestId":"LhRlXP6H2EQo8M0ECUlL8js4W9CP99h5fvsSHjVSs3mhB9OupvWpz7UdB1HhN0Ntxf6sFLYoHdk=","statusCode":403,"retryable":false,"retryDelay":44.73750370088965}</p>
</blockquote>

<p>Second one is of-course different. </p>

<p>I tried using empty <code>options</code> object without luck.</p>

<p>Any kind of advice is welcome. Thanks in advance.</p>

<p>Tried working with different key/key id , same result. And how do I get the uploaded file's url? That of-course after I can successfully upload images :p</p>