是否可以在单个 JSON 消息中将一组图像二进制文件返回到浏览器?

发布于 2024-10-07 14:26:36 字数 172 浏览 0 评论 0原文

从上传的角度来看,我们可以使用 MIME multipart 在单个请求中携带多个文件。我想知道 Web 服务器是否可以通过单个 JSON 消息将一组图像(二进制文件)返回到客户端的浏览器?如果是这样,浏览器是否可以通过使用标签检索多个图像来进行解复用和渲染?

请指教。

谢谢&问候, 威廉

From the point of view of uploading, we can use MIME multipart to carry multiple files within a single request. I'm wondering if it is possible for a web server returning set of images (binaries) through a single JSON message to the browser at the client side? If so, is it able to be demuxed and rendered by the browser as retrieving multiple images by using tags?

Please advise.

Thanks & regards,
William

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

因为看清所以看轻 2024-10-14 14:26:36

您可以使用base64对图像进行编码并包含在json中。然后使用数据方案 URI 来检索图像。

有关数据方案 URI 的更多信息。
http://en.wikipedia.org/wiki/Data_URI_scheme

You can use base64 to encode the image and included in json. Then use data scheme URI to retrive the image.

More about data scheme URI.
http://en.wikipedia.org/wiki/Data_URI_scheme

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文