check in display image using api now

This commit is contained in:
2025-09-10 11:15:56 +10:00
parent 6cea606cc2
commit ff45c461a5
23 changed files with 335 additions and 59 deletions
@@ -22,7 +22,7 @@ public class FileUploadController : ControllerBase
_config = config;
}
[HttpPost("UploadFile")]
[HttpPost("[action]")]
public async Task<IActionResult> UploadFile(IFormFile file)
{
List<CodeDto<string>> output = new ();
@@ -36,7 +36,7 @@ public class FileUploadController : ControllerBase
// Define the upload directory
// var uploadsFolder = Path.Combine(_hostingEnvironment.WebRootPath, "uploads");
string importFolder = _config.GetValue<string>("ImportFolder");
string importFolder = _config.GetValue<string>("AppSettings:ImportFolder");
var uploadsFolder = Path.Combine(_hostingEnvironment.ContentRootPath, importFolder);
if (!Directory.Exists(uploadsFolder))
{
@@ -72,4 +72,11 @@ public class FileUploadController : ControllerBase
return StatusCode(500, $"Internal server error: {ex.Message}");
}
}
[HttpPost("[action]")]
public async Task<IActionResult> DownloadFile(DownloadFileCriteria criteria)
{
var rev = await _importPersonRepository.DownloadFile(criteria);
return Ok(rev);
}
}