I\'m trying to post JSON via AJAX to a Classic ASP page, which retrieves the value, checks a database and returns JSON to the original page.
I can post JSON via AJAX. I
Generally (new VBArray(arr).toArray()) should work on a SafeArray, which is what Request.BinaryRead returns. But it doesn't. I found this solution which I revised:
function GetRawRequestData() {
var byteCount = Request.TotalBytes;
var binary = Request.BinaryRead(byteCount)
var reader = Server.CreateObject('ADODB.Recordset');
reader.Fields.Append('x', 201, byteCount);
reader.Open();
reader.AddNew();
reader.Fields(0).AppendChunk(binary);
reader.update();
return reader.Fields(0).Value;
}
thanks to Rasberry's comment @ http://blogs.msdn.com/b/david.wang/archive/2006/07/04/howto-convert-between-jscript-array-and-vb-safe-array.aspx
Note that it might not handle encoding correctly. I didn't dive into what 201 for ADO datatype means, but it works.