修改读取文件方式

development
温天培 1 year ago
parent 51872e047a
commit c17bce3d11

@ -1063,6 +1063,13 @@
<param name="input"></param>
<returns></returns>
</member>
<member name="M:GDZZ.Application.AnnexService.DownloadFileInfo(GDZZ.Application.AnnexInput)">
<summary>
下载附件
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:GDZZ.Application.AnnexService.Add(Microsoft.AspNetCore.Http.IFormFile,System.String)">
<summary>
增加附件管理
@ -1136,6 +1143,11 @@
附件管理输入参数
</summary>
</member>
<member name="P:GDZZ.Application.AnnexInput.Id">
<summary>
文件名
</summary>
</member>
<member name="P:GDZZ.Application.AnnexInput.FileName">
<summary>
文件名
@ -2125,6 +2137,13 @@
<param name="backInput"></param>
<returns></returns>
</member>
<member name="M:GDZZ.Application.FeedBackService.UpFeedBack(GDZZ.Application.FeedBackInput)">
<summary>
添加意见反馈
</summary>
<param name="backInput"></param>
<returns></returns>
</member>
<member name="T:GDZZ.Application.InvitationCodeDto">
<summary>
邀请码表输出参数

@ -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(App.WebHostEnvironment.WebRootPath, annexfile.FileUrl, annexfile.Id+".pdf");
var filePath = App.WebHostEnvironment.WebRootPath+annexfile.FileUrl;
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;

Loading…
Cancel
Save