Accessing ArrayBuffer from PHP $_POST after xmlHTTPrequest send()

Posted by Dan on Stack Overflow See other posts from Stack Overflow or by Dan
Published on 2012-07-02T21:12:34Z Indexed on 2012/07/02 21:15 UTC
Read the original article Hit count: 291

I'm following the tuitions on XMLHttpRequest 2 from :

https://developer.mozilla.org/en/DOM/XMLHttpRequest/Sending_and_Receiving_Binary_Data and http://www.html5rocks.com/en/tutorials/file/xhr2/#toc-send-arraybuffer

They're great tutorials for the client side, and here is a working extract from my script:

var imagebuffer = new ArrayBuffer(size);  // create the readonly memory buffer
var imagedata= new Uint8Array(imagebuffer); // create a view to manipulate data

// do some cool stuff with imagedata

var exchange=new XMLHttpRequest();
exchange.open("POST",url,true);
exchange.send(arraybuffer);

So far so good, and I can see from the both client and server control panels that plenty of data is being transferred.

Here's my problem: how do I access the ArrayBuffer with PHP at the server? I'm used to the $_POST superglobal wanting parameters passing from a HTML form so it can be accessed as an array but I can't find any reference for how to access this binary array and stick it in my MySQL database.

© Stack Overflow or respective owner

Related posts about php

Related posts about AJAX