|
|
@ -60,7 +60,7 @@ namespace GDZZ.Application
|
|
|
|
var annexfile = await this._rep.FirstOrDefaultAsync(x => x.Id == input.Id);
|
|
|
|
var annexfile = await this._rep.FirstOrDefaultAsync(x => x.Id == input.Id);
|
|
|
|
if (annexfile == null)
|
|
|
|
if (annexfile == null)
|
|
|
|
throw Oops.Oh("文件为空,下载失败");
|
|
|
|
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 fileName = HttpUtility.UrlEncode(annexfile.FileName, Encoding.GetEncoding("UTF-8"));
|
|
|
|
var result = new FileStreamResult(new FileStream(filePath, FileMode.Open), "application/octet-stream") { FileDownloadName = fileName };
|
|
|
|
var result = new FileStreamResult(new FileStream(filePath, FileMode.Open), "application/octet-stream") { FileDownloadName = fileName };
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|