Storing Physical Path on database instead of virtual one
<p>My problem I believe is simple, but I am struggling with it.
When I upload image files, it works fine, but the path on database is physical one, like <strong>C://user/pictures/blabla....</strong> .
I would like to change it to <strong>virtual path (~/...)</strong>. 
The images are displyed when I change manually the database path to virtual one.
Thanks in advance for any help.
Here are my codes:</p>

<p><strong>CONTROLLER</strong></p>

<pre><code>public ActionResult Create(DriverReg model, HttpPostedFileBase file)
        {
            if (ModelState.IsValid)
            {
                if (file != null &amp;&amp; file.ContentLength &gt; 0)
                {
                    var fileName = Path.GetFileName(file.FileName);
                    var phisicalPath = Path.Combine(Server.MapPath("~/Content/uploads/"), fileName);
                    file.SaveAs(phisicalPath);
                    DriverReg newRecord = new DriverReg();
                    newRecord.FullName = model.FullName;
                    newRecord.Address = model.Address;
                    newRecord.Postcode = model.Postcode;
                    newRecord.Contact = model.Contact;
                    newRecord.Email = model.Email;
                    newRecord.County = model.County;
                    newRecord.File = phisicalPath;
                    newRecord.Date = DateTime.Now;

                    db.DriverRegs.Add(newRecord);
                    db.SaveChanges();
                    return RedirectToAction("Index");
                }
            }

            return View(model);
        }
</code></pre>

<p><strong>CREATE VIEW</strong></p>

<pre><code>&lt;div class="form-group"&gt;
                @Html.LabelFor(model =&gt; model.File, htmlAttributes: new { @class = "control-label col-md-2" })
                &lt;div class="col-md-10"&gt;
                    &lt;input type="file" class="file-input" name="file" /&gt;
                    @Html.ValidationMessageFor(model =&gt; model.File, "", new { @class = "text-danger" })
                &lt;/div&gt;
            &lt;/div&gt;
</code></pre>

<p><strong>DETAILS VIEW</strong></p>

<pre><code> &lt;dt&gt;
                @Html.DisplayNameFor(model =&gt; model.File)
            &lt;/dt&gt;

            &lt;dd&gt;
                @Html.Image(@Model.File, "image")
            &lt;/dd&gt;
</code></pre>