Hi @ahmed salah ,
web api below return physical file as zip file
in case of compare excel return true
but I need when compare excel function return false
to display message "Not matched compare"
so How to do it please ?
In the ExportNormalizedRelation method, you could use a if-else
statement to return the data.
Like this:
[HttpPost, DisableRequestSizeLimit]
[Route("ExportNormalizedRelation")]
public IActionResult ExportNormalizedRelation()
{
bool areIdentical =false;
if (areIdentical)
{
var zipPath = @"C:\Users\Administrator\Downloads\AspNetCore-3x-RCL-plugins-master.zip";
return File(System.IO.File.ReadAllBytes(zipPath), "application/zip", Path.GetFileName(zipPath));
}
else
{
return Ok("Not Matched Compare");
}
}
Then, the result as below:
If the areIdentical
is true:
If the areIdentical
is false:
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Dillion