_btn.addEventListener(MouseEvent.MOUSE_UP, myMouseUp);
function myMouseUp(e:Event){
var req:URLRequest = new URLRequest("test_request.php");
req.data = byte_array_data;
req.method = URLRequestMethod.POST;
req.contentType = 'application/octet-stream';
flash.net.navigateToURL(req, "_blank");
}
<?php
$ data = $ GLOBALS['HTTP_RAW_POST_DATA'];
if (is_null($ data)) {
echo "No data was sent";
} else {
$ file = fopen("test.jpg", "w") or die("Can't open file");
if(!fwrite($ file, $ data)){
echo "Error writing to file";
}
print "OK\n";
fclose($ file);
}
?>