Hi All,
I struggle with drag and drop and upload file to a remote server.
I can upload file using FileReference (_fr), this is working fine :
private function ev_SelectedFile(e:Event):void {
var url:URLRequest = new
URLRequest("http://myserver.com/upload_file.php")
url.method = "POST";
trace ("selected1:" + (e.currentTarget as
FileReference).fileReference.name);
trace ("selected2:" + (e.currentTarget as
FileReference).fileReference.size); _fr.upload(url);
}
Now, instead to be _fr.browse(), I want the source of upload to be a
drag and drop file.
I have an event working using jewel DropZone when I drop a file, but how
to setup FileReference ? Here is my buggy code :
private function ev_dropped(e:DroppedEvent):void {
trace ("dropped");
//_fr.fileReference = new File((e.data[0] as
DroppedModel).fileData.array,"test.mp3");
_fr.fileContent = (e.data[0] as DroppedModel).fileData;
var url:URLRequest = new
URLRequest("http://myserver.com/upload_file.php")
url.method = "POST";
_fr.upload(url),
}
Thank in advance for help
Regards
Fred