$cordovaFileTransfer.upload [solved]

You can upload multiple files with $ cordovaFileTransfer.upload?

Google is your friend, look at the upload function below.

If you’re developing for Blackberry then you’ll need to make sure that you wait for $cordovaFileTransfer.upload to finish uploading the file before calling it again otherwise it triggers an InvalidStateError: DOM Exception 11 error.

The following is an example function that queues the files and uploads them one at a time.

function uploadFiles(server, filePaths, options) {
	var q = $q.defer();
	function processUpload(fileUploadResult) {
		var filePath = filePaths.pop();
		if (filePath) {
			console.log('uploadFiles: uploading ' + filePath);
			$cordovaFileTransfer.upload(server, filePath, options(filePath)).then(processUpload, q.reject);
		else {
			q.resolve({ success: true });
	console.log('uploadFiles: ' + filePaths.length + ' files queued');
	return q.promise;

Then you can just do something like the following.

var filePaths = [

uploadFiles('http://server.dev/upload', filePaths, function(filePath) {
	return {
		fileKey: 'file',
		params: {
			filePath: filePath
		chunkedMode: false

Thank you very much!
It was a great help!