Skip to main content
Participating Frequently
October 16, 2007
Question

DWfile.copy not working

  • October 16, 2007
  • 1 reply
  • 351 views
I have an extension that I am building and I need to copy a file automatically from the config folder to the users local site when they apply the extension:

I've tried this:
var fileURL = "file:///C|/Config/Objects/GJHDigital/test123.gif";
var SiteFolder = site.getLocalPathToFiles() + "Test";
DWfile.createFolder(SiteFolder);
DWfile.copy(fileURL, SiteFolder);

And I tried this:
var path = dw.getConfigurationPath()+'/Objects/GJHDigital/test123.gif"';
var path2 = site.getLocalPathToFiles();
DWfile.copy(path, path2);

and both do not work. No errors or anything. And the folders do exist. Does anyone know how to do this with Dreamweaver MX 2004? Because I understand there is a new way in CS3, which I do not have yet.
This topic has been closed for replies.

1 reply

Inspiring
October 18, 2007
When you use DWfile.copy() you have to specify the file name in the "Copy To" path so try this: