JavaScript

{dialog.object}phoneGapMoveFileURL Method

Syntax

{dialog.object}.phoneGapMoveFileURL(srcFilepath, destDirpath, destFilename, onMoveSuccess, onError);

Arguments

srcFilepath

Local file URL for the file to be moved.

destDirpath

The URL of the directory to move the file.

destFilename

The file name for the moved file. If null, the source filename will be used.

onMoveSuccess

A javascript function that is called if the file is successfully moved.

onError

A javascript function that is called if an error occurs when moving the file. See the cordova-plugin-file documentation for more information about error codes.

Description

Move a file.

Example

var onMoveSuccess = function() { 
	alert("File was moved!");
};
var onError = function(e) { 
	alert("An error occurred when moving the file!");
};
var srcPath = {dialog.object}.phoneGapGetLocalDirURL('private') + 'file.txt';
var destinationDirPath = {dialog.object}.phoneGapGetLocalDirURL('saved');
var destinationName = null; //use same name as source
{dialog.object}.phoneGapMoveFileURL(srcPath, destinationDirPath, destinationName, onMoveSuccess, onError);

See Also