jeudi 13 août 2015

No file chosen even when file is chosen - mvc

I'm updating record so I'm viewing an Edit page that I created, when I change the values and choose another file to be uploaded rather than previous and press update button, the error I see is "no file chosen" below the choose file control. Why is it so when I'm choosing the file.

I'm using the following code for the file upload:

   <div class="form-group">
        @Html.LabelFor(model => model.File, new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.TextBoxFor(model => model.File, new { type = "file", accept = "image/*" })
            @Html.ValidationMessageFor(model => model.File)
        </div>
    </div>

While creating this record same code is used and it works fine, then what could be the problem when trying to update a record?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire