Hello,
I'm trying to open a UNC network path from my flex web app but it doesn't work.
Can somebody tell me how to do ?
I tried these examples :
1.
var url:URLRequest = new URLRequest("file:"+data.url); //data.url = "\\myserver\mydir\myfile.xls";
navigateToURL(url, '_blank');
2.
ExternalInterface.call("window.open", data.url);
3.
var uri:URI; //from as3corelib
uri = new URI();
uri = new URI("file://"+data.url);
4.
uri = new URI(data.url);
but none of them work.
Thanks for advance.
I haven't done it with a local path, but I do it all the time with a URL path. If it's the same method (which I would guess) then you're missing some things. Add the following line to your fx:script:
import flash.net.navigateToURL;
then create your function:
private function openLocalPath(): void {
navigateToURL( new URLRequest("\\myserver\mydir\myfile.xls"),
"_blank");
}
Let us know if that helps, and good luck!
I was curious so I did some quick googling. This came from an older flex version, but the logic may give some clues:
"A local SWF file describes any file referenced by using the "file:\\" protocol or a UNC path, which does not include an IP address or a qualifying domain. For example, "\\test\test.swf" and "file:\\test.swf" are considered local files, while "\\test.com\test.swf" and "\\192.168.0.1\test.swf" are not considered local files."
I pulled this quote from this site:
http://livedocs.adobe.com/flex/3/html/help.html?content=security2_03.h tml
Not something I've actually tested, but it sounded like a few clues might be in there.
According to trials I've done, the navigateToURL method works only if you put the "http://" before your link. It means in other words that it's not adapted for UNC network path.
If Somebody knows another method or way for accessing UNC network path, any suggestion would be welcome...
North America
Europe, Middle East and Africa
Asia Pacific