SignatureDoesNotMatch error when uploading to s3 via a pre signed url using Ionic 2
<p>I am trying to upload a video to s3 and have a pre-signed PUT url. The following is the code to do so. </p>

<pre><code>import {Component} from '@angular/core';
import {NavController} from 'ionic-angular';
import {MediaCapture} from 'ionic-native';
import {Http} from '@angular/http';
import { Transfer } from 'ionic-native';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})

export class HomePage {

    public base64Image: string;

    constructor(private navController: NavController, public http: Http) {
        this.base64Image = "https://placehold.it/150x150";
    }

    public takeVideo() {
        MediaCapture.captureVideo({limit:2}).then(function(videoData){
            var link = "https://mysamplebucket.s3.amazonaws.com/non-tp/esx.mov?AWSAccessKeyId=TEMP_KEYY&amp;Expires=1482290587&amp;Signature=JUIHHI%2FcnLkqSVg%3D&amp;x-amz-security-token=FQoDYXDGRfTXk6hma0Rxew6yraAX%2FlYGaQmYLwkvsuuB3%2F%2FtPvGDVs3dIQG0Ty3MeMjn0p%%26djt5xhAMk73pndJbZP0tCYYlvPvlUAyL8x7O%%2B3AwEa%%2B9b43yarIuPLCvujmKLTDyi%%3D%3Di";

            var options: any;

            options = {
             fileKey: 'file',
             fileName: 'esx.mov',
             httpMethod: 'PUT',
             chunkedMode: false,
             mimeType: 'video/quicktime',
             encodeURI: false,
             headers: {
                'Content-Type': 'video/quicktime'
              }
            };

            var ft = new Transfer();
            ft.upload(videoData[0].fullPath, link, options, false)
                .then((result: any) =&gt; {
                    this.success(result);
                }).catch((error: any) =&gt; {
                    this.failed(error);
                }); 

        }, function(err){
            alert(err);
        });
    }


}
</code></pre>

<p>Here is the code that generates the pre-signed PUT url. </p>

<pre><code>var params = {Bucket: s3_bucket, Key: filename, Expires: 900000};
var url = { 
    'url' : s3.getSignedUrl('putObject', params)
};
</code></pre>

<p>I get, <code>SignatureDoesNotMatch</code> error. The message says, <code>The request signature we calculated does not match the signature you provided. Check your key and signing method.</code> I am not sure what I am doing wrong here - I looked a few other SO and Ionic questions and tried what they recommended to no avail. Any ideas on what I and doing wrong? </p>