.NET Core Web API - how to return search result images to the client
I'm writing a .NET Core Web API and am trying to return search results with their associated images. The images are stored in directories. Can I return the view model with the images, or do I return the view model, then make a call to retrieve each image.
Any examples would be appreciated. I have found lots of examples of uploading files from client to server, but can't find the reverse.
Posted Sep 1, 2020, 6:59 AM UTC
Personally I'd return the URL to the location of the image render it using an <img> tag in your HTML.
Make sure your images are stored in a location accessible by the client browser.
This. Maybe even store the images on a separate server to the main app - like a static asset server.
Thanks.
Thanks. I'll look into it.