Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Silvija 8 posts 88 karma points
    6 days ago

    Avatar image upload failed

    I am working with member API and i am trying to upload the image when registering. After i register the member and open backoffice i see this: enter image description here


    public class RegisterController : SurfaceController
        // GET: Register
        public ActionResult Register(Models.RegisterModel model)
            if (!ModelState.IsValid)
                return CurrentUmbracoPage();
            var memberService = Services.MemberService;
            if (memberService.GetByEmail(model.Email) != null)
                ModelState.AddModelError("", "A member with that email alredy exists");
                return CurrentUmbracoPage();
            var member = memberService.CreateMemberWithIdentity(model.Email, model.Email, model.Name, "bMEMembers");
            member.SetValue("companyName", model.CompanyName );
            member.SetValue("avatar", model.Avatar);
            memberService.SavePassword(member, model.Password);
            Members.Login(model.Email, model.Password);
            return Redirect("/");


    public class RegisterModel
        public string Name { get; set; }
        public string Email { get; set; }
        public string Password { get; set; }
        public string CompanyName { get; set; }
        public HttpPostedFileBase Avatar { get; set; }
        public string ExistingProfilePicture { get; set; }


        @Html.LabelFor(model => model.Name)
        @Html.EditorFor(model => model.Name)
        @Html.ValidationMessageFor(model => model.Name)
        @Html.LabelFor(model => model.Email)
        @Html.EditorFor(model => model.Email)
        @Html.ValidationMessageFor(model => model.Email)
        @Html.LabelFor(model => model.Password)
        @Html.PasswordFor(model => model.Password)
        @Html.ValidationMessageFor(model => model.Password)
        @Html.LabelFor(model => model.CompanyName)
        @Html.EditorFor(model => model.CompanyName)
        @Html.ValidationMessageFor(model => model.CompanyName)
        @Html.LabelFor(model => model.Avatar)
        <input type="file" name="Avatar" />
        @Html.ValidationMessageFor(model => model.Avatar)
        <input class="btn" type="submit" value="Create" />

    I am using Umbraco 8 and i followed tutorial from Umbraco TV

  • Silvija 8 posts 88 karma points
    4 days ago

    I have tried this code in umbraco v7 and it works.

    Nobody knows why is it not working in Umbraco 8?

Please Sign in or register to post replies

Write your reply to: