function(config) {
                var options = new FileUploadOptions();
                options.fileKey = config.fileKey || "file";
                options.fileName = this.path.substr(this.path.lastIndexOf('/') + 1);
                options.mimeType = config.mimeType || "image/jpeg";
                options.params = config.params || {};
                options.headers = config.headers || {};
                options.chunkMode = config.chunkMode || true;

                var fileTransfer = new FileTransfer();
                fileTransfer.upload(this.path, encodeURI(config.url), config.success, config.failure, options, config.trustAllHosts || false);
                return fileTransfer;
            }
function(config) {
                var options = new FileUploadOptions();
                options.fileKey = config.fileKey || "file";
                options.fileName = this.path.substr(this.path.lastIndexOf('/') + 1);
                options.mimeType = config.mimeType || "image/jpeg";
                options.params = config.params || {};
                options.headers = config.headers || {};
                options.chunkMode = config.chunkMode || true;

                var fileTransfer = new FileTransfer();
                fileTransfer.upload(this.path, encodeURI(config.url), config.success, config.failure, options, config.trustAllHosts || false);
                return fileTransfer;
            }
function ( config ) { var options = new FileUploadOptions ( ) ; options . fileKey = config . fileKey || "file" ; options . fileName = this . path . substr ( this . path . lastIndexOf ( '/' ) + 1 ) ; options . mimeType = config . mimeType || "image/jpeg" ; options . params = config . params || { } ; options . headers = config . headers || { } ; options . chunkMode = config . chunkMode || true ; var fileTransfer = new FileTransfer ( ) ; fileTransfer . upload ( this . path , encodeURI ( config . url ) , config . success , config . failure , options , config . trustAllHosts || false ) ; return fileTransfer ; }
Send a file to a server

@param {Object} config

@param {String} config.url
URL of server to receive the file

@param {Boolean} config.trustAllHosts
(Optional) If true it will accept all security certificates. Defaults to false

@param {String} config.fileKey
Name of the form element. Defaults to "file"

@param {String} config.fileName
Name of the file on the server

@param {String} config.mimeType
mime type of the data being uploaded. defaults to "image/jpeg"

@param {Object} config.params
(Optional) set of key/value pairs to be passed along with the request

@param {Boolean} config.chunkMode
Should the data be uploaded in a chunked streaming mode. defaults to true

@param {Object} config.headers
Map of header name => header values. Multiple values should be specified an array of values
var headers={'headerParam':'headerValue'};

@param {Function} config.success
The function called when the File is uploaded successfully

@param {Function} config.success.metadata

@param {Function} config.failure
The function called when the File upload fails

@param {FileError} config.failure.error

@returns {FileTransfer}
Send a file to a server