Skip navigation
GAUSSARD
Currently Being Moderated

Is there a way to open UNC network path in flex ?

Oct 12, 2012 8:09 AM

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.

 
Replies
  • Currently Being Moderated
    Oct 12, 2012 8:33 AM   in reply to GAUSSARD

    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!

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 12, 2012 8:58 AM   in reply to GAUSSARD

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 30, 2012 1:31 PM   in reply to GAUSSARD

    UNC is not supported.  You have to map to drive letters.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points