check in display image using api now
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user