Вам необходимо передать его с вашего сервера. Должно работать что-то вроде ниже;
[HttpGet]
public HttpResponseMessage GetImage(int employeeId)
{
// TODO: Adjust path by parameter employeeId...
string picturePath = @"//192.168.100.202/shared/photo/Shared/EmployeePhoto/32019/197416.Jpeg";
FileStream fileStream = new FileStream(picturePath, FileMode.Open, FileAccess.Read);
HttpResponseMessage response = request.CreateResponse(HttpStatusCode.OK);
response.Content = new StreamContent(fileStream);
response.Content.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg");
return response;
}
(Это связано с тем, что общая папка не является частью веб-приложения и предоставление доступа к внешним файлам может, помимо прочего, представлять угрозу безопасности.)
Поскольку вы используете angular, вы можете сделать что-то подобное в html (в зависимости от того, как выглядят ваши привязки);
<img [src]="'api/MyController/GetImage?employeeId=' + employee.Id"
onerror="this.onerror = null; this.src = 'content/images/StaticMissingPicture.png'; this.style = 'opacity: 0.5'; this.title = 'Could not get picture';"
class="img-fluid rounded mx-auto d-block"
alt="Employee picture" />