Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个已经用 base64 编码的图像,我如何确定这个对象有多大。我想告诉应用程序的用户,这个文件是否需要很长时间才能传输。
如果您已编码为 Base64 字符串,那么您通过网络传输的大小就是字符数。由于 Base64 适合 ASCII 的字符空间,因此您通过网络传输的字节很简单:
var bytes = encodedString.length
如果大小是一个主要问题,您可能需要考虑不对图像进行 Base64 编码。Base64 将每 6 位转换为 8 位字符表示。这意味着您在 Base64 编码时将原始值乘以 4/3。
xhtml的代码如下:
<h:form enctype="multipart/form-data" id="importForm"> <table cellpadding="0" cellspacing="0" border="0"> <tr>
1 cassandra - Cassandra Hector:给定行键和二级索引的 IndexedSliceQuery
1 sql - 获取下一次登录
1 jfreechart - 带有滚动条的 Jfreechart 引起
1 android - 图片未显示在滚动视图中的 android imageview 中
1 android - 接收触摸的所有窗口顶部的 Android 覆盖布局
2 c# - 使用带有 C# 的 LINQ 使用 LIKE 和 OR 查询数据集
Reference php × 1429865 c/c++ × 756500 nginx × 49975 mongodb × 159057 mybatis × 3233 anaconda × 13410 pycharm × 14671 python × 1902243 vscode × 56040 docker × 110988 github × 49000 flask × 49129 ffmpeg × 24037 jmeter × 16910 matplotlib × 63493 bootstrap × 54641