![]() The client must decode the Base64 encoded image.Ī basic pattern in Web API is one action returns file information. You can, however, Base64 encode an image and return the Base64 encoded image as part of a JSON or XML content type. It is not possible to return two files streams or a file stream and JSON. The content type can be a file, HTML, JSON, XML etc. In HTTP you can return one stream content type. If I understand your question, the requirement is not possible due to HTTP fundamentals. Public ImageAPIController(IImagesFilesRepository imgrepo ) Private readonly IImagesFilesRepository imgrepo Public class ImageAPIController : ControllerBase Var userImagePath = Path.Combine(env.ContentRootPath, "Images") ĭirectoryInfo dir = new DirectoryInfo(userImagePath) Public ImagesFilesRepository(IHostingEnvironment env)įileUploadAPI modelFile = new FileUploadAPI() Private readonly IHostingEnvironment env Public class ImagesFilesRepository : IImagesFilesRepository This is the code public class FileUploadAPI I want to return image list and its details from the API Get method rather than string Please can you someone can help me to display the images in postman from my code. jpg files) and the file details of each files in postman, from the folder images from web api controller.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |