预览pdf日志

optimize
wanghaomei 2 years ago
parent 4ecaedac98
commit 493d604cbd

@ -2527,11 +2527,13 @@ namespace Myshipping.Application
var fileFullName = Path.Combine(fileFullPath, fn);
if (File.Exists(fileFullName))
{
_logger.LogDebug($"预览pdf文件{fileFullName}");
var readMem = new ReadOnlyMemory<byte>(File.ReadAllBytes(fileFullName));
_httpContextAccessor.HttpContext.Response.BodyWriter.WriteAsync(readMem);
}
else
{
_logger.LogDebug($"未找到预览pdf文件{fileFullName}");
_httpContextAccessor.HttpContext.Response.StatusCode = 404;
}
}

Loading…
Cancel
Save