fixed download if no image return empty
This commit is contained in:
@@ -111,12 +111,21 @@ public class FileUploadController : ControllerBase
|
||||
return Ok(ret);
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("[action]")]
|
||||
public async Task<IActionResult> DownloadPersonPhoto(DownloadFileCriteria criteria)
|
||||
public async Task<IActionResult> DownloadPersonPhotoById(DeleteCriteria<int> criteria)
|
||||
{
|
||||
|
||||
var result = await _personPhoto.DownloadPersonPhoto(criteria.Id,criteria.PhotoType ,criteria.FileName);
|
||||
var result = await _personPhoto.DownloadPersonPhotoById(criteria.Id);
|
||||
if (result.StatusCode > 0)
|
||||
return File(result.Data.Content, result.Data.ContentType, result.Data.FileName);
|
||||
else
|
||||
return NotFound("not found image");
|
||||
}
|
||||
[HttpPost("[action]")]
|
||||
public async Task<IActionResult> DownloadPersonPhotoPerson(DownloadFileCriteria criteria)
|
||||
{
|
||||
|
||||
var result = await _personPhoto.DownloadPersonPhotoPerson(criteria.Id,criteria.PhotoType ,criteria.FileName);
|
||||
if (result.StatusCode > 0)
|
||||
return File(result.Data.Content, result.Data.ContentType, result.Data.FileName);
|
||||
else
|
||||
@@ -126,7 +135,7 @@ public class FileUploadController : ControllerBase
|
||||
public async Task<IActionResult> DownloadPersonPhoto64(DownloadFileCriteria criteria)
|
||||
{
|
||||
|
||||
var result = await _personPhoto.DownloadPersonPhoto(criteria.Id,criteria.PhotoType ,criteria.FileName);
|
||||
var result = await _personPhoto.DownloadPersonPhotoPerson(criteria.Id,criteria.PhotoType ,criteria.FileName);
|
||||
if (result.StatusCode > 0)
|
||||
{
|
||||
byte[] file64 = result.Data.Content;
|
||||
|
||||
Reference in New Issue
Block a user