简体   繁体   English

在javascript中发送和接收blob

[英]Send and receive a blob in javascript

I want to send a blob using a JQuery ajax request and receive it server-side with Node.js + express. 我想使用JQuery ajax请求发送blob,并使用Node.js + express接收服务器端。

I would send the blob as a JSON string, but it seems that none of the binary data is included in it: 我会将blob作为JSON字符串发送,但似乎没有包含二进制数据:

{"type":"audio/wav","size":344108}

How else could it be sent? 怎么还能发送?

JSON doesn't support binary data. JSON不支持二进制数据。 You will have to encode your binary data first: Binary Data in JSON String. 您必须首先编码二进制数据: JSON字符串中的二进制数据。 Something better than Base64 比Base64更好的东西

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM