【发布时间】:2020-02-03 20:10:27
【问题描述】:
我正在使用 rn-fetch-blob 在 react-native (android) 中下载 PDF 文件。文件下载成功,但当我尝试打开时显示“无法打开文件”。
RNFetchBlob.config({
fileCache: true,
appendExt : extension,
addAndroidDownloads : {
useDownloadManager: true,
notification : true,
path: DownloadDir + "/me_"+Math.random().toString().slice(2, 6) + '.' + extension,
mime : 'application/pdf',
mediaScannable : true,
}
})
.fetch('GET', 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf'
, { 'Cache-Control': 'no-store' })
.then((res) => {
alert('The file has saved!')
console.log('The file saved to ', res)
})
【问题讨论】:
标签: android react-native