Skip to main content
Inspiring
April 9, 2007
Question

File.CopyTo across servers

  • April 9, 2007
  • 1 reply
  • 280 views
I need to copy recorded streams from server to server. I planned on using the File.CopyTo function, but I have two questions.

First, the PDF documentation of the server side actionscript states that "If ... the destination file doesn’t exist, the operation
fails..." (pg 70.) Do I first need to create the destination file by opening it in "create" mode before using the CopyTo function?

Second, I am assuming that I should be able to use the file naming convention "//server/app/dir/filename" for the destination file to copy the file from server A to server B using the mapped locations. But something's nagging at me telling me this won't work. In the documentation the naming instructions kind of imply that file copies only work within a single server. The example doesn't show either an app name or server. I want to do this:

Code running on source server.
var fileToCopy = new File("/dir/filename");
fileToCopy .CopyTo("//destserver/app/dir/filename")


If that's no good, can I copy the file from the source server to the destination server from the destination app? For instance:

Code running on destination server.
var fileToCopy = new File("//srcserver/app/dir/filename");
fileToCopy .CopyTo("/dir/filename")


If someone could clarify this for me I'd appreciate it.

Thanks.
    This topic has been closed for replies.

    1 reply

    NeeeolAuthor
    Inspiring
    April 9, 2007
    Never mind.. I just saw another post on a similar topic and it's pretty clear i can't do this.