1234567891011121314151617181920212223 |
- using CZFW.Core;
- using Microsoft.AspNetCore.Mvc;
- using Microsoft.AspNetCore.StaticFiles;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- namespace CZFW.CMS.Admin.Controllers
- {
- public class ResourceController:Controller
- {
- public IActionResult Load(string siteId, string fileType,string fileName)
- {
- //var path = $"{ConfigHelper.GetValue<string>("ResourcePathRoot")}\\{siteId}\\{fileType}\\{fileName}";
- var path = $"{ConfigHelper.GetValue<string>("ResourcePathRoot")}/{siteId}/{fileType}/{fileName}";
- var mimetypeProvider = new FileExtensionContentTypeProvider();
- var mimetype = mimetypeProvider.TryGetContentType(path, out string contentType);
- return PhysicalFile(path, contentType);
- }
- }
- }
|