Rolf B: responseType ArrayBuffer

Beitrag lesen

Hallo pl,

ArrayBuffer ist ein JavaScript-Typ. Den erzeugst Du weder mit Perl noch PHP. Wie Robert schon schrieb - du kannst bei einem AJAX-Call den responseType "arraybuffer" setzen und bekommst dann als response einen ArrayBuffer.

Voraussetzung:

When setting responseType to a particular value, the author should make sure that the server is actually sending a response compatible with that format. If the server returns data that is not compatible with the responseType that was set, the value of response will be null.

Wobei diese Restriktion wohl eher für Responsetypen wie "json" oder "document" gelten dürfte. Einen ArrayBuffer sollte man aus jeder Response konstruieren können. Insofern musst Du in PHP oder Perl eigentlich gar nichts tun, um im Browser deinen ArrayBuffer zu bekommen.

D.h. du hast irgendein spezifischeres Problem, vermutlich bezogen auf den gewünschten Inhalt des ArrayBuffer. Magst Du uns davon erzählen?

Rolf

--
sumpsi - posui - clusi