From 10e57be6d1e47af82a4266e04b1bd0b5d006dc1c Mon Sep 17 00:00:00 2001 From: taohebin Date: Wed, 20 Nov 2024 12:28:06 +0800 Subject: [PATCH] update: pages/API/download-file/download-file.uvue --- pages/API/download-file/download-file.uvue | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pages/API/download-file/download-file.uvue b/pages/API/download-file/download-file.uvue index 37052268..82d8c88b 100644 --- a/pages/API/download-file/download-file.uvue +++ b/pages/API/download-file/download-file.uvue @@ -11,6 +11,10 @@ 点击按钮下载服务端示例图片(下载网络文件到本地临时目录) + + + 下载接口的Content-Disposition中的filename非法值例子 + @@ -66,6 +70,17 @@ this.task?.onProgressUpdate((update) => { console.log("progress : ", update.progress); }) + }, + downloadErrorFilename(){ + uni.downloadFile({ + url:"https://qiniu-web-assets.dcloud.net.cn/uni-app-x/static/file/test9.txt", + success: (res) => { + console.log('downloadFile success, res is', res.tempFilePath) + }, + fail: (err) => { + console.log('downloadFile fail, err is:', err) + } + }) }, //自动化测试例专用 jest_downloadFile() { -- GitLab