Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get nativePath of file using FileReference

I am developing an application using Adobe AIR.

How can we get absolute path of file or "nativePath" of file (as we call it in Flex/AIR) when we use FileReference to browse a file ?

I know there are security concerns related to this but is there any hack or is there a direct solution that I am unaware of?

Please help me out.

Thanks.

like image 861
Prashant Avatar asked Feb 04 '26 13:02

Prashant


1 Answers

Since File extends FileReference, you can do this:

var file:File = new File();
file.addEventListener(Event.SELECT, onSelect);
file.browse();


private function onSelect(e:Event):void
{
   trace(e.target.nativePath);
}
like image 119
J_A_X Avatar answered Feb 08 '26 23:02

J_A_X



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!