base64格式的pdf,怎么保存到本地
- 发布:2022-08-13 15:03
- 更新:2022-10-13 16:47
- 阅读:808
FullStack - 【插件开发】【专治疑难杂症】【ios上架、马甲包、白包、过审、已成功上架过几百个】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=22130】【非诚勿扰】QQ:543610866
plus.nativeObj.Bitmap
同问 老哥 我是base的excel文件,从后端获取arraybuffer转为base64怎么保存呢
-
1***@163.com (作者)
类似通过以下方
base64ToPath(base64) {
var fileName = '水箱清洗工单_' + (new Date()).valueOf() + '.pdf'
var binaryData = base64.split('base64,')[1]
return new Promise(function(resolve, reject) {
if (typeof plus === 'object') {
var basePath = '_doc'
var dirPath = '水箱清洗工单'
var filePath = basePath + '/' + dirPath + '/' + fileName
plus.io.resolveLocalFileSystemURL(basePath, function(entry) {
entry.getDirectory(dirPath, { create: true, exclusive: false }, function(entry) {
entry.getFile(fileName, { create: true, exclusive: false }, function(entry) {
entry.createWriter(function(writer) {
writer.onwrite = function() {
resolve(filePath)
}
writer.onerror = reject
writer.seek(0)
writer.writeAsBinary(binaryData)
}, reject)
}, reject)
}, reject)
}, reject)
}
})
},2022-10-15 10:27
1***@163.com (作者)
这个不是只能保存64的图片文件吗?pdf也可以吗?
2022-08-15 09:53