Page 1 of 1

Copying a file from a remote or server location

Posted: April 27th, 2010, 9:59 am
by adamghering
I would like to copy a file from a server share to the local drive. I can already copy a file from drive to drive and folder to folder locally. In the java script toolkit it makes reference to the path like this

If a path name starts with two slashes (or backslashes on Windows), the first element refers to a remote
server. For example, //myhost/mydir/myfile refers to the path /mydir/myfile on the server myhost.

also
//myServer/share/file

my copy script is simple like
myfile = File("c:\\File.txt);
myfile.copy("D:\\);

this works and copies the file I just need to know the proper syntax to insert the server location in the myfile object that is designated any help would be appreciated

thanks in advance

Re: Copying a file from a remote or server location

Posted: May 5th, 2010, 5:39 am
by lloydalvarez
Hi Adam,

You can use my Batch Search and Replace Paths script to see how AE sees a path. Import the file you would like to know the path of into AE and run the script in Test mode with the XML option off. This will generate a text log file which will show you the path the way AE sees it.

Lloyd

Re: Copying a file from a remote or server location

Posted: May 11th, 2010, 1:19 am
by adamghering
Ok ...so another one down.

for those of you interested.
When you declare an instance of the file object you want to copy you also need to state the file name in the target path to where you will be copying the file to ...

for instance

MyFile = File.("//Servername/data/MyFile.txt");
MyFile.copy("c:\\Folder\\MyFile.txt");

This should do it...I tried everything ...who knew you needed to declare the file in the destination...

cheers,