title: Cordova fileupload errors in xcode - "WebKit discarded an uncaught exception"
body: <p>I'm having a hard time getting the FileTransfer to work in Cordova 1.6.0. I haven't tried it in earlier version, so I don't know if this is a new issue or not.</p>
  
  <pre><code>var options = new FileUploadOptions();
  options.fileKey = "file";
  
  var ft = new FileTransfer();
  ft.upload( 
      imageURLToLocalFile, 
      urlToMyServiceEndpoint, 
      successhandler,
      errorhandler,
      options
  );
  </code></pre>
  
  <p>In the Xcode console I see. </p>
  
  <pre><code>*** WebKit discarded an uncaught exception in the
  webView:decidePolicyForNavigationAction:request:frame:decisionListener: 
  delegate: &lt;NSRangeException&gt; ***
   -[JKArray objectAtIndex:]: index (1) beyond bounds (1)
  </code></pre>
  
  <p>Seems to me that when the Cordova exec function is calling the native Filehandler functions this happens, but I have no idea how to interpret the error message.</p>
  
  <p>I am a little bit suspicious about the call that creates the error, the FileTransfer.prototype.upload function in the Cordova file. I the 1.6.0 version it is:</p>
  
  <pre><code>exec(
      successCallback, 
      errorCallback, 
      'FileTransfer', 
      'upload', 
      [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode]
  );
  </code></pre>
  
  <p>While the older 1.5.0 version is:</p>
  
  <pre><code>Cordova.exec(
      successCallback,
      errorCallback,
      'org.apache.cordova.filetransfer', 
      'upload', 
      [options]
  );
  </code></pre>