Ok, I keep getting null returned on my photo, What am I missing?

I've trid this Uploading/Displaying Images in MVC 4

But Im obviously looking to include the image as part of model. Model

public class Client
    {
        public string Name{ get; set; }
        public string ClientId { get; set; }
        public HttpPostedFileBase Photo{ get; set; }
}

Page

@using (Html.BeginForm()) { 
    @Html.ValidationSummary(true)
    <div class="form-horizontal" role="form">
                        <div class="form-group">
                            <label for="@Model.Name" class="col-sm-2 control-label">Name:</label>
                            <div class="col-sm-10">
                                <input name="ClientId" type="hidden" value="@Model.ClientId" id="ClientId" data-val="true" data-val-required=" required">
                                <input type="text" id="Name" value="" class="form-control" tabindex="1" placeholder="name" name="Name" required/>
                                @Html.ValidationMessageFor(model => model.Name)
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="@Model.Name" class="col-sm-2 control-label">Image:</label>
                            <div class="col-sm-10">
                                @Html.TextBoxFor(m => m.Photo, new { type = "file" })
                            </div>
                        </div>
}

Controller

[HttpPost]
        [Authorize]
        public ActionResult New(ViewModels.Client client)
        {
if (client.Photo!= null)
            {
                var photo= new byte[client.Photo.ContentLength];
                client.Photo.InputStream.Read(photo, 0, client.Photo.ContentLength);

            }
}

Related posts

Recent Viewed