JavaScript

{dialog.object}phoneGapCopyFileURL Method

Syntax

{dialog.object}.phoneGapCopyFileURL(srcFilepath,destDirpath,destFilename,onCopySuccess,onError);

Arguments

srcFilepath

Local file URL for the file to be copied.

destDirpath

The URL of the directory to copy the file.

destFilename

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

onCopySuccess

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

onError

A javascript function that is called if an error occurs when copying the file.

Description

Copies a file from one location to another on the file system.

Example

var onCopySuccess = function() { 
    alert("File was copied!");
};
var onError = function(e) { 
    alert("An error occurred when copying the file!");
};
var srcPath = {dialog.object}.phoneGapGetLocalDirURL('private') + 'file.txt';
var destinationDirPath = {dialog.object}.phoneGapGetLocalDirURL('saved');
var destinationName = 'file2.txt';
{dialog.object}.phoneGapCopyFileURL(srcPath, destinationDirPath, destinationName, onCopySuccess, onError);