I get this error
SecurityError: #2000 No active security context
in Flash when trying to upload an image file on the server.
Here is the code:
Code: Select all
private function someButtonClick(evt: MouseEvent):void {
_loadFile = new FileReference();
_loadFile.addEventListener(Event.SELECT,uploadSelectHandler);
var fileFilter:FileFilter = new FileFilter("Images: (*.jpeg, *.jpg, *.gif, *.png)", "*.jpeg; *.jpg; *.gif; *.png");
_loadFile.browse([fileFilter]);
}
private function uploadSelectHandler(event:Event):void
{
_loadFile.removeEventListener(Event.SELECT, uploadSelectHandler);
trace("uploadSelectHandler " + _loadFile.name); //displays the correct file name
var req:URLRequest = new URLRequest(rD.sF.httpUploadURI);
req.method = URLRequestMethod.POST;
_loadFile.upload(req); //throws error #2000
}
- _loadFile has the correct file name once loaded and I can display its content in a sprite without problem
- I'm testing this locally on Windows XP
- server version is 2.9.0 and client version 1.2.5
- Upload files is enabled in the Zone configurator
- So is the Web server, HTTP enabled and HTTP port is 8080
- FILE_UPLOAD event handler is defined on the server and of course is never fired
- Crossdomain.xml accepts everything (*)
- I use Flash CS5.5
- Local playback security is "Access network only" but I get the same error with "Access local files only"
- It doesn't work whether I'm inside Flash or a browser (I don't know if it technically throws the same error when inside a browser)
Any ideas?
Thanks