I was working with FMS 3.5 and using the function 'copyTo()' to copy a file to a desired location.
Code: fileObject.copyTo("store/"+name+".flv")
store is a virtual directory defined in Application.xml file in the server side and name is a variable that stores the fileName without extension
This was working fine with FMS 3 and FMS 3.5.
Now, I moved to FMS 4 and noticed that this copyTo() function is not working.
In the FMS Admin Console, it throws an error:Error: File operation copyTo failed.
Can anyone please help me in solving this issue.
Thanks in advance...
FMS 4 has stronger security settings and one of them includes FMS Administrators needing to enable virtual directories for the scripting file object. It's possible that this setting is NOT enabled for your installation, and the warning in the core logs has not been observed - please check Server.xml for
"VirtualDirectoryForFile" configuration - this will need to have enable=true to allow this setting to operate.
LMK if this helps the situation.
Asa
Hi, I have a similar problem. Here's my code:
var source = new File(src);
var destination = new File(dst);
source.copyTo( destination );
This does not work even if destination is in the same directory.
Absolute paths also don't work, as well as relative paths.
I'm using a stock Amazon EC2 FMS.
Could you please help me? I want to avoid using cgi and external programs.
Can we at least know why it failed? Because the error message is not really helpful:
2012-06-15 11:22:22 29348 (e)2641173 Sending error message: /mnt/applications/livepkgr/main.asc: line 9: Error: File operation copyTo failed. -
Did it failed to open a the source for reading? Did it failed to open destination for writing? Did it failed to find source file? How can I know it?
Is there a debugger apart from "trace" for server side actionscript?
Thank you
You are missing one more configuration setting to get this to work.
There are two settings, the first one is the one you already found, the VirtualDirectoryForFile in the Server config.
But there is another one in the vHosts Application.xml:
In there, there is also a FileObject element, with the attribute override="no"
This denies any settings you might put into your applications Application.xml.
If you set the attributes value to "yes", everything will work like you want it to.
North America
Europe, Middle East and Africa
Asia Pacific