title: Upload image to server angularjs
body: <p>I need to upload an image taken from my mobile device to my server. I found the angular-upload library to which makes reference. I need to do is to transform the image base 64, send it by post to my server because the server is where I will work with her. And the other, send from my server and work it from the application to run.</p>
  
  <pre><code>var server = URL_BASE+'addView/';
  
  var trustAllHosts = true;
  
  var ftOptions = new FileUploadOptions();
  ftOptions.fileKey = 'file';
  ftOptions.fileName = $scope.imagen.substr($scope.imagen.lastIndexOf('/') + 1);
  ftOptions.mimeType = 'image/jpeg';
  ftOptions.httpMethod = 'POST';
  
  console.log(ftOptions);
  
  $cordovaFileTransfer.upload(encodeURI(server), $scope.imagen, ftOptions, trustAllHosts)
  .then(function(result) {
    console.log(result)
  }, function(err) {
    // Error
    console.log(err);
  }, function (progress) {
  
  });
  </code></pre>