Getting absolute local path in Flex

I looked around, and the last link I saw was from 2008, which says that the standard browser FileReferencedoes not support retrieving the absolute local path of the user file, unless it is an AIR application, and indeed, the documents do not say anything. The reason for this is, apparently, some erroneous security concern ... I have no great idea that any flash application should know your directory structure, but if the user actually provides a file for your application, I think it doesn’t void security to find out only this absolute file path.

I am wondering if the state has changed at all with Flex 4, and there is a way to get the local file name. I need this because I am making an application that, when distributed, runs locally in 99% of cases, so fully downloading a file just to save it somewhere else on the local machine seems silly. (Plus, the standard file upload method does not support SOAP, which I use for all my other services ...) I can always just enter the user type in my local path, but it seems really stupid.

+3
source share
2 answers

Due to security concerns in Flash (not AIR), you are not allowed to see the full path of the fileReference file.

+3
source

, - , .

" "

flash player 10 , . FileReference.download() , , (, ).

FileReference: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.html#download%28%29

, , - .

, Windows-, , - - :

"C:\Documents and Settings\ [ ]\ \myAwesomeFile.txt"

, .

, AIR - .

0

Source: https://habr.com/ru/post/1768737/


All Articles