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;