I am trying display images on the webpage from the folder placed in my project root directory. The path that I am storing in the database is as follows:
D:\Projects\OnlineStore\OnlineStore\OnlineStore\Content\Uploads\Images\Bundles\706976d31e274e7ab36986b9bec2f0f9-Object Image.jpg
The code that generated this path is as follows:
var path = Path.Combine(Server.MapPath("~/Content/Uploads/Images/Bundles"), fileId);
photo.SaveAs(path);
Image doesn't show using this path. The path that works is as follows:
\Content\Uploads\Images\Bundles\706976d31e274e7ab36986b9bec2f0f9-Object Image.jpg
How do I resolve this issue? I was thinking about using first path to save image file to folder and save second path in the database. But this doesn't seem the right way of doing this.