public async Task <ActionResult> AttachMediaToPost(Guid id, List <IFormFile> files, IWebHostEnvironment _environment) { try { _postService.AttachMediaToPost(id, files, _environment.WebRootPath); return(Ok()); } catch (Exception e) { _logger.LogError($"Failed to attahc media to post with GUID : {id} {e.Message}", e); return(BadRequest("Failed to attach media to post, please check the log")); } }