Avatar

Community Advisor

Hi somasundaramh14124455,

Please find the sample code where I am trying to cope a file and paste it with another name. It is working fine for me. Please double check the path and if it is correct you can reach out to Adobe support.

Code Snippet

var file = new File("/usr/local/neolane/nl6/var/res/instance_name/mypic.png"); 

if(!file.exists)

     logError ("File '" + file.fullName + "' does not exists.");

else

     logInfo("File '" + file.fullName + "' exists.");

if (!file.copyTo("/usr/local/neolane/nl6/var/res/instance_name/halloween.png")) 

     logError ("File '" + file.fullName + "' was not copied.");

else

     logInfo("File '" + file.fullName + "' was copied.");

var copiedfile = new File("/usr/local/neolane/nl6/var/res/instance_name/halloween.png");

if(!copiedfile.exists)

     logError ("File '" + copiedfile.fullName + "' does not exists.");

else

     logInfo("File '" + copiedfile.fullName + "' exists.");

Log

File '/usr/local/neolane/nl6/var/res/instance_name/mypic.png' exists.

File '/usr/local/neolane/nl6/var/res/instance_name/mypic.png' was copied.

File '/usr/local/neolane/nl6/var/res/instance_name/halloween.png' exists.

Workflow finished

Regards,

Deb