【问题描述】 imageBuffer: ArrayBuffer如何转成Uri去上传文件 我这边用了图片压缩,压缩之后获取到imageBuffer: ArrayBuffer,但是上传文件要用uri,imageBuffer如何转成Uri呢? 深色代码主题 复制 let newPath = context.cacheDir + `/select.png`; // 图片压缩 const imageSourceApi: image.ImageSource = image.creat...
const arraybuffer = new Int8Array(buffer.data); 1. ArrayBuffer -> Blob const blob = new Blob([arraybuffer], { type : 'application/pdf'}); 1. 项目案例:前端通过 ajax(responseType = 'blob')获取文件数据进行下载。代码如下,downloadFromS3 是共通方法通过 AWS S3 获取文件,因为返回的是 nodejs ...
const arraybuffer = new Int8Array(buffer.data);ArrayBuffer -> Blobconst blob = new Blob([arraybuffer], { type : 'application/pdf'});项目案例:前端通过 ajax(responseType = 'blob')获取文件数据进行下载。代码如下,downloadFromS3 是共通方法通过 AWS S3 获取文件,因为返回的是 nodejs 的 Buffer 类型...