I have an application that saves its streams not in its application directory, but somewhere else by using the following in my application.xml:
<Application>
<StreamManager>
<VirtualDirectory>
<!-- Specifies application specific virtual directory mapping for streams. -->
<Streams>/;C:\pathtomystreams</Streams>
</VirtualDirectory>
</StreamManager>
</Application>
This is working nicely. Now, what I am trying to do is to get a list of streams in that directory. The only way I know how to do it is to use the File object, create a File object of my streams folder, and then call File.list().
The Adobe help mentions that I can use Virtual Directories also for the File object: http://livedocs.adobe.com/flashmediaserver/3.0/hpdocs/index.html
<FileObject>
<VirtualDirectory>/;C:\pathtomystreams</VirtualDirectory>
</FileObject>
The Adobe help does not mention here where the FileObject tag should be nested, but a look in the vHosts Application.xml pointed me to that it should be in Application/ScriptEngine. I also set the override attribute of the FileObject Element to "yes" in the vHosts Application.xml.
But I just don't get the right path. when I write code like this in my main.asc:
var f = new File("/mystream.flv");
trace(f.toString());
the resulting trace reads C:\\mystream.flv and not C:\pathtomystreams\mystream.flv Interestingly, it also is ignoring any VirtualPath that I might add into the vHosts Application.xml
Probably there is some configuration setting I am missing. Does anyone have an idea what I might be missing here, or what I am doing wrong?
There is indeed another configuration setting in the Server.xml I have overlooked:
<Root>
<Server>
<Security>
<!-- This is disabled by default. -->
<VirtualDirectoryForFile enable="true"/>
</Security>
</Server>
<Root>
The element VirtualDirectoryForFile has to be enabled to get it to work. So you have to make sure to have the override attribute set to true in the vHost.xml, and make sure that the enable attribute on VirtualDirectorForFile in the Server.xml is set to true.