4

I am using cordova file transfer to dowload a file from aws s3 using signed url, since cordova filetransfer encodes the uri, the "%" in signature is converted to "%25", thus, results in signature mismatch

Inayath Ebrahim
  • 203
  • 2
  • 9

1 Answers1

7

Try setting up your options like so:

options = {
            fileKey: 'file',
            fileName: name,
            chunkedMode: false,
            mimeType: 'audio/3gpp',
            httpMethod: 'PUT',
            // Important!
            headers: {
                'Content-Type': 'audio/3gpp' // < Set explicitly otherwise it becomes multipart/form-data which won't work with S3
            },
            encodeURI: false // < Stops any extra encoding by file transfer logic
        }

Took me many painful hours getting pre signed PUTs working with cordova / S3. Goodluck.

derekdon
  • 136
  • 9
  • This issue happens with the ng-cordova plugin. There's an issue about it : https://github.com/driftyco/ng-cordova/issues/835 – pyb Dec 26 '15 at 16:36