title: Ionic android - Upload file to S3 using presigned URL (Error code: 3)
body: <p>I am trying to upload image from ionic application to S3 using presigned URL. </p>
  
  <p>This is the current situation:</p>
  
  <p>Ionic application sends request to server to get presigned upload URL from AWS S3. </p>
  
  <p>On server side I have a node application that is using aws-sdk to get presigned URL and then returns it back to client. </p>
  
  <p>This is my code on Ionic side that should upload file to AWS</p>
  
  <pre><code>var options = {
    fileKey: 'file',
    fileName: fileName,
    mimeType: 'image/jpeg',
    chunkedMode: false,
    timeout: 300000,
    httpMethod:'PUT',
    encodeURI: false,
    headers: {
      'Content-Type': 'image/jpeg'
    }
  };
  var ft = new FileTransfer();
  ft.upload(cordova.file.dataDirectory + fileName, uploadLink, function () {
    console.log("image uploaded");
  }, function (err) {
    console.log(err);
  }, options);
  </code></pre>
  
  <p><strong>This code works on iOS device</strong>, but when I deploy application to Android and try to upload file it fails with the following error:</p>
  
  <blockquote>
    <p>FileTransferError body: null code:3 exception: "Write error:
    ssl=0x8ec63f80: I/O error during system call, Connection reset by
    peer" http_status: null source:
    "file:///data/user/0/com.ionicframework.xxxxxxxx/files/xxxxx.jpg"
    target: "<a href="https://xxxxxx.s3.eu-central-" rel="nofollow noreferrer">https://xxxxxx.s3.eu-central-</a> ..... "</p>
  </blockquote>
  
  <p>Ionic info 
  Cordova CLI: 6.4.0
  Ionic CLI Version: 2.1.12
  Ionic App Lib Version: 2.1.7</p>
  
  <p>Android version on device is 6.0</p>
  
  <p>I am a bit confused as it is work on iOS but it doesn't work on android. I have used cordova file transfer before and have never run into similar situation. However this is the first time that I am uploading files from android to S3 directly. </p>
  
  <p>Any help would be highly appreciated. </p>