From 51872e047a217abd66ffe256c73db567c148edbe Mon Sep 17 00:00:00 2001 From: wtp <1813748440@qq.com> Date: Wed, 22 Nov 2023 16:51:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=99=84=E4=BB=B6=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GDZZ.Application/Service/Annex/AnnexService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GDZZ.Application/Service/Annex/AnnexService.cs b/GDZZ.Application/Service/Annex/AnnexService.cs index 061fa23..87a51b3 100644 --- a/GDZZ.Application/Service/Annex/AnnexService.cs +++ b/GDZZ.Application/Service/Annex/AnnexService.cs @@ -60,7 +60,7 @@ namespace GDZZ.Application var annexfile = await this._rep.FirstOrDefaultAsync(x => x.Id == input.Id); if (annexfile == null) throw Oops.Oh("文件为空,下载失败"); - var filePath = Path.Combine(this._options.Default.path, annexfile.FileUrl, annexfile.FileName); + var filePath = Path.Combine(App.WebHostEnvironment.WebRootPath, annexfile.FileUrl, annexfile.Id+".pdf"); var fileName = HttpUtility.UrlEncode(annexfile.FileName, Encoding.GetEncoding("UTF-8")); var result = new FileStreamResult(new FileStream(filePath, FileMode.Open), "application/octet-stream") { FileDownloadName = fileName }; return result;