简体   繁体   English

将 Base64 png 信息作为 URL 中的查询字符串传递时接收错误

[英]Receiving error when passing Base64 png info as query sting in URL

Attempting to pass Base64 image data in Url to web page on same domain.试图将 Url 中的 Base64 图像数据传递到同一域上的 web 页面。 Query string works correctly for text strings, but receiving error -VM8:2759 crbug/1173575, non-JS module files deprecated - when attaching the base64 data.查询字符串适用于文本字符串,但在附加 base64 数据时收到错误 -VM8:2759 crbug/1173575,不推荐使用非 JS 模块文件。

var url = "somepage.html?name=" + encodeURIComponent("sometext") + "&image=" + base64Data;

Base64 data was initially fetched from a php script, and being forwarded from one webpage to another - same domain. Base64 数据最初是从 php 脚本中获取的,然后从一个网页转发到另一个网页 - 同一个域。 Image file does not exist on the server.服务器上不存在图像文件。

Using gigantic query strings can be problematic, because different browsers have different rules, and in your case, the base64 blob image string could be compromised by URL encoding etc.使用巨大的查询字符串可能会出现问题,因为不同的浏览器有不同的规则,在您的情况下,base64 blob 图像字符串可能会受到 URL 编码等的影响。

https://stackoverflow.com/a/812962/1772933 https://stackoverflow.com/a/812962/1772933

It's really best practice to use POST to send this quantity of data.使用POST发送此数量的数据确实是最佳实践。

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

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