Uat_Study
parent
1bd70131ce
commit
7db0a20426
|
@ -3,6 +3,8 @@ using System.Text;
|
|||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
|
@ -11,17 +13,17 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
private readonly IDoctorService _doctorService;
|
||||
private readonly IAttachmentService _attachmentService;
|
||||
private readonly IHostEnvironment _hostEnvironment;
|
||||
private readonly IWebHostEnvironment _hostEnvironment;
|
||||
private string defaultUploadFilePath = string.Empty;
|
||||
private readonly ILogger<FileService> _logger;
|
||||
public FileService(IDoctorService doctorService, IAttachmentService attachmentService,
|
||||
IHostEnvironment hostEnvironment, ILogger<FileService> logger)
|
||||
IWebHostEnvironment hostEnvironment, ILogger<FileService> logger)
|
||||
{
|
||||
_doctorService = doctorService;
|
||||
_attachmentService = attachmentService;
|
||||
_hostEnvironment = hostEnvironment;
|
||||
|
||||
defaultUploadFilePath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\')).IfNullThrowException().FullName;
|
||||
defaultUploadFilePath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
|
@ -37,9 +39,10 @@ namespace IRaCIS.Application.Services
|
|||
//准备下载文件的临时路径
|
||||
var guidStr = Guid.NewGuid().ToString();
|
||||
|
||||
//string uploadFolderPath = HostingEnvironment.MapPath("/UploadFile/");
|
||||
string uploadFolderPath = Path.Combine(defaultUploadFilePath, "UploadFile");
|
||||
|
||||
|
||||
|
||||
var tempSavePath = Path.Combine(uploadFolderPath, "temp", guidStr); //待压缩的文件夹,将需要下载的文件拷贝到此文件夹
|
||||
if (!Directory.Exists(tempSavePath))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue