I need just to display the multiple images I insert it save will in path, but when he showed it does show up. I don't know where is my problem but this is my code please guys help me?
My Controller
public async Task<ActionResult> Create(Inbox model, IEnumerable<HttpPostedFileBase> files)
{
var currentUser = await manager.FindByIdAsync(User.Identity.GetUserId());
if (ModelState.IsValid)
{
model.User = currentUser;
foreach (var file in files)
{
if (file != null && file.ContentLength > 0)
{
var fileName = Path.GetFileName(file.FileName);
var path = Path.Combine(Server.MapPath("~/FilesAPP"), fileName);
file.SaveAs(path);
path = Url.Content(Path.Combine("~/FilesAPP", fileName));
}
}
db.Inboxs.Add(model);
db.SaveChanges();
string url = Url.Action("List");
return Json(new { success = true, url = url });
}
return View(model);
}
My model
public string Files { get; set; }
And my View
<img width="200" height="150" src="@Url.Content(Model.Files))" />
How can I display my images guys?