-
1. Re: AS3 Flex - users on Windows can select any file on FileReference.browse regardless of FileFilter
sinious Sep 10, 2012 12:14 PM (in response to saariko)ALWAYS validate. Every time, no questions asked. Otherwise welcome to hackville.
Regardless, Windows users know wildcards like * can gain access to any file type regardless what you do with your dialog filter settings.
e.g.:
import flash.events.Event;
import flash.net.FileReference;
import flash.net.FileFilter;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
function onEnterFrame(e:Event):void
{
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
var f:FileReference = new FileReference();
f.browse([new FileFilter("Filez","*.jpg;*.mp4;*.swf")]);
}
When I run this I only see folders and files of those 3 types. The drop-down for file type only contains the entry "Filez", there is no "All Files (*.*)". YMMV on different versions of windows but there's always a way to escape. On Windows just enter an asterisk in the filename prompt and it will show every file type regardless. There is no getting around this.
That leads me to the first sentence in this response again. ALWAYS validate. Even if this issue never came up, you should validate.
-
2. Re: AS3 Flex - users on Windows can select any file on FileReference.browse regardless of FileFilter
saariko Sep 10, 2012 12:18 PM (in response to sinious)that is a complete and helpful answer. validate it is!
thanks
-
3. Re: AS3 Flex - users on Windows can select any file on FileReference.browse regardless of FileFilter
sinious Sep 11, 2012 6:08 AM (in response to saariko)You're welcome and good luck!



