HarmonyOS 鸿蒙Next 使用云函数上传图片,一直报base64太长了,无法上传,怎么解决

发布于 1周前 作者 eggper 最后一次编辑是 5天前 来自 鸿蒙OS

HarmonyOS 鸿蒙Next 使用云函数上传图片,一直报base64太长了,无法上传,怎么解决

import { cloudFunction } from ‘@kit.CloudFoundationKit’;
import { BusinessError } from ‘@kit.BasicServicesKit’;

cloudFunction.call({ name:‘myhandlerxxxx’, version:’$latest’, timeout:10*1000, data:{ param1:‘data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAApFQTFRFAAAA////MFDvKFD3KFX6KFP4gID/JlP5KFD3JVD4JU/3JlD4KVL1JlD3J0/5QID/J1D4Jk/3J0/4J1H6K1X/J1D3Jk/3LFn0KFT2J1L5JVH2JlH5JlL3KFD4K0/5M2b/JVH5J1D2J1H5LFn/J1X3JlD3JlH4JlD3K1X/JlH6K1XVLVP4LE/2JlD3Jk/4KE/5VVX/J0/4JlH2JlH4K1X3JG3/JlD3KVL6JlD2JlD6JlD3JlD3QGD/LlHzJk/4JlH2J1D4J1D4J1P6JVD4JVH3KlP6JVHzJ1H4KlP5JlD4Jk/5LVrwQED/J1D4J1H3KFH3JlD3J1D1J1D4JU/3M2bMKFD2M03mJU/4J1H4JlD3JlH4Jk/4M2b/JlH3Ll3oKVL3JlH3J1H5KFD1JlD4JlD4JlL6J1H4N1vtK1X/J1D3JlH4KVP4JlD3J1L3JlH4K1X4KFL4OVX/KFH/Jk/4KFH4J1H4MVXzJ0/4JlD3JVD4KFH4KlP6KFD/JlD4LVP/J1D5KFD3JlD4SW3/Jk/4JlH5KVP4JlD4JVD4JlD4KVL4J1H4J1H6Jk/4KFH3KFH4JlD3JU/4KVL3JlH4J1L3JVD3JVD4M1n/Ll3/KFH7J1D4J0/3M1nyKFHyJ1D5JlD3J1D4JlD3JlD4KVL1K1X/Jk/4Jk/3J1L2JlD3KF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wc3WRjAbgurkh9z9cFNEqp3in2/fltLgAXRaKvePN8MHZMjs2TndhdAK5V4YT/soXX2oeF3Srbb93nhv0FkPsmWPyhictzk4gd9+wXdn72F+ANAnARfKP3FE9fAxOjawy2m81PHy8RQK4PRtUzVlcH5SXhweCuXnDz5+E1AnDhLN422dPXAKD8hFQvsmB4kwBcNKxdCliDwkO8+s1++8WskPAyAbgY8m8tUKE9D5B09ogdzf1EvE8ALoY0/hKccN8ysr49tMLT18CBVwrARcf7vrrHPkvDiClX0pd5+iL48FYBuHBUcbYEp943kb1LZxW1c8g6GS8WgAvUpd/SvZ5cHCaENdxmamlR0/FuAeSCdi751Jxq4RRinzh8/Kj33voFeL8AcnEs+u/UMRaU17hFTsKyg06v//Fz8Q0B5II2Tj30FLBYrSH2HtnbPtqrH/uF8R0B5BEc0OvuABGxO/rUWrBpdBXbb/Ax4WMCyMOx4t+/t/2XNUsnGWdw89LPFfOJh74aXxRAHqjipBEr717nMDozSC6dHHViQt+ffOaZ74bPCqAAVDu9U9b8I9eqsKbvSq6UXTI6vtmBI776yxfg6wK4Bar4Us7P9RcOXvjV2e7P7vtjl7ujWcL99zyxPKFT4LjXv2n34P5/Vvn4734LvxGAO0gJUKKOlXs4aM9vNTdfdS3sPH1BHsJvBSDJRwrAz5EC8HOkAPwcKQA/RwrAz5EC8HOkAPwcKQA/RwrAz5EC8HOkAPyc/wdBHkjETNDv8AAAAABJRU5ErkJggg==’, param2:‘val2’ } }).then((value: cloudFunction.FunctionResult) => { console.info(Succeeded <span class="hljs-keyword">in</span> calling the <span class="hljs-function"><span class="hljs-keyword">function</span>, <span class="hljs-title">result</span>: <span class="hljs-title">$</span>{</span><span class="hljs-built_in">JSON</span>.stringify(value.result)}); }).catch((err: BusinessError) => { console.error(Failed to call the <span class="hljs-function"><span class="hljs-keyword">function</span>, <span class="hljs-title">Code</span>: <span class="hljs-title">$</span>{</span>err.code}, message: ${err.message}); })

5 回复

字符串过长 应该是长度超出了云测可以接收的范围。可以做以下的优化:

1.压缩图片:

在转换为Base64之前,先尝试压缩图片。可以使用不同的压缩算法或调整图片质量来减小文件大小。

使用工具或库(如PIL/Pillow, OpenCV等)来降低图片的分辨率或质量。

2.分片传输:

如果云服务支持,可以将图片数据分成多个部分,并分别进行Base64编码和传输。

在服务器端重新组装这些部分

3.使用二进制传输:

如果可能,直接以二进制形式上传图片而不是转换为Base64

云函数没看到二进制上传的方式

适当程度压缩图片大小. 可以限制一个固定的大小.

不行哦,业务就是自定义图片大小的

针对HarmonyOS鸿蒙Next使用云函数上传图片时遇到的“base64太长了,无法上传”的问题,这通常是由于图片数据经过Base64编码后数据量过大,超出了云函数的处理限制。

为了解决这个问题,你可以尝试以下方案:

  • 图片压缩:在上传前,使用鸿蒙系统提供的图片处理API对图片进行压缩,减小图片的体积,从而降低Base64编码后的数据量。
  • 分段上传:如果图片数据过大,可以考虑将图片分割成多个小块,分别进行Base64编码和上传,然后在服务器端重新组合这些小块。
  • 优化云函数配置:检查并优化云函数的配置,看是否有增加数据接收限制的可能。

如果上述方案仍然无法解决问题,建议检查云函数和鸿蒙系统的相关文档,确保你的实现方式符合系统的要求。如果问题依旧没法解决请联系官网客服,官网地址是:https://www.itying.com/category-93-b0.html

回到顶部