导表测试
This commit is contained in:
@@ -5,10 +5,11 @@ using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
using Microsoft.AspNetCore.StaticFiles;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -57,7 +58,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||
//}
|
||||
|
||||
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpGet("CommonDocument/DownloadCommonDoc")]
|
||||
public async Task<IActionResult> DownloadCommonFile(string code, [FromServices] IRepository<CommonDocument> _commonDocumentRepository)
|
||||
{
|
||||
@@ -77,9 +78,9 @@ namespace IRaCIS.Core.API.Controllers
|
||||
throw new Exception("服务器本地不存在该路径文件");
|
||||
}
|
||||
|
||||
new FileExtensionContentTypeProvider().Mappings.TryGetValue(Path.GetExtension(filePath), out var contentType);
|
||||
return File(System.IO.File.OpenRead(filePath), contentType ?? "application/octet-stream", doc.Name);
|
||||
|
||||
var stream = System.IO.File.OpenRead(filePath);
|
||||
return File(stream, "application/octet-stream", Path.GetFileName(doc.Name));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user