从浏览器发送二进制数据
我想知道如何以二进制类型从客户端向服务器发送数据?
我使用的是 Chrome 14,当我在客户端应用程序中发送 ArrayBuffer
时,我会收到一个 opcode
设置为 opText
的帧和一个字符串作为服务器应用程序中的帧数据“[object ArrayBuffer]”。
我应该怎么办?
I wanted to know what I must do for sending data in binary type from client to server?
I am using Chrome 14, and when I send an ArrayBuffer
in the client application, I receive a frame with the opcode
set to opText
and a string as frame data "[object ArrayBuffer]"` in the server application.
What should I do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该下载最新的夜间版本,因为它仅在 Chrome 16 中实现(目前是开发者频道)。您还可以下载 Chrome Canary。
目前,在 Chrome 14/15 中,您只能发送字符串,因此
ArrayBuffer
会转换为字符串:someArrayBuffer.toString() === "[object ArrayBuffer]"< /代码>。
它已在 WebKit 修订版
94482
中实现,但 Chrome 14(内部版本第835章 835 href="http://src.chromium.org/viewvc/chrome/branches/835/src/DEPS?revision=98687&view=markup" rel="nofollow">WebKit 修订版91698
< /a>.You should download the latest nightly build since it has only been implemented in Chrome 16 (currently that's the developer channel). You could also download Chrome Canary.
Currently, in Chrome 14/15, you can only send strings and as such, an
ArrayBuffer
is converted to a string:someArrayBuffer.toString() === "[object ArrayBuffer]"
.It has been implemented in WebKit revision
94482
, but Chrome 14 (build 835) only includes up to WebKit revision91698
.