Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

copying files into site

New Here ,
Sep 17, 2007 Sep 17, 2007

Copy link to clipboard

Copied

How can I create an extension that when added automatically adds a required file/folder to the current dreamweaver website? I've seen other extensions add javascript and .gif files and folders but I cannot find any tutorials on how to do this.

Example is: I have an extension that places a link to a local file. I need to add that file into the users dreamweaver site so they can ftp it along with the webpage.

Thanks in advance
TOPICS
Extensions

Views

707
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 17, 2007 Sep 17, 2007

Copy link to clipboard

Copied

quote:

Originally posted by: gjhdigital
How can I create an extension that when added automatically adds a required file/folder to the current dreamweaver website? I've seen other extensions add javascript and .gif files and folders but I cannot find any tutorials on how to do this.

Example is: I have an extension that places a link to a local file. I need to add that file into the users dreamweaver site so they can ftp it along with the webpage.

Thanks in advance


That functionality is already built into dreamweaver

try linking to a file outside your site, it'll pop up a message like the one below


This file is outside of the root folder of site 'mysite',
and may not be accessible when you publish the site.

Your root folder is:
C:\sites\mysite\

Would you like to copy the file there now?
---------------------------
Yes No
---------------------------

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 17, 2007 Sep 17, 2007

Copy link to clipboard

Copied

thanks for responding, but what my extension is doing is adding some html to the page along with some javascript mouse events, and I am referencing a seperate .js file that has the functions that will need to be added automatically to the site in the same folder as where the webpage is. I dont want the developer using my extension having to go and search for my .js file and then add it to their site. I want it to copy their once they finish using the extension.

Do you know how to do that?
thanks

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 17, 2007 Sep 17, 2007

Copy link to clipboard

Copied

"gjhdigital" <webforumsuser@macromedia.com> wrote in message
news:fcmiee$4mf$1@forums.macromedia.com...
> thanks for responding, but what my extension is doing is adding some html
> to
> the page along with some javascript mouse events, and I am referencing a
> seperate .js file that has the functions that will need to be added
> automatically to the site in the same folder as where the webpage is. I
> dont
> want the developer using my extension having to go and search for my .js
> file
> and then add it to their site. I want it to copy their once they finish
> using
> the extension.
>
> Do you know how to do that?
> thanks

Sure, Dreamweaver CS3 introduces the function dom.copyAssets,
http://livedocs.adobe.com/en_US/Dreamweaver/9.0_API/dwr_pagecontent_cn_088.html
you pass it an array of AssetInfo objects, which are defined in
Shared/Common/Scripts/AssetInfoClass.js
for earlier versions of dreamweaver you'd have to create your own function
using DWFile.copy
http://livedocs.adobe.com/en_US/Dreamweaver/9.0_API/dwr_fileio_fi_04.html

Joris



Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 08, 2007 Oct 08, 2007

Copy link to clipboard

Copied

LATEST
I'm trying to use these DW functions to add a file to a site after someone finishes using my extension. The createFolder works but I cant copy the file which will be in the file:///C|/Config/Objects/GJHDigital/ folder that Dreamweaver creates when installed.

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

It does not return an error but if I put the function in an alert, I get a "false" on the DWFile.copy method.

thanks in advance.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines