Hi Tommy,
something is missing in your implementation, and it belongs to file upload.
Please have a look to our TYPO3 implementation i posted some minutes ago (when it is reviewed - why are new posts here are reviewed?)
Just in short:
in Router:
$data->data = array($_POST, $_FILES);
should read
$data->data = array($_POST + $_FILES);
and for the response of file uploads you will need something like
Code:$response = json_encode($response); $response = preg_replace('/"/', '\\"', $response); $response = array( '<html><body><textarea>' . $response . '</textarea></body></html>' );