title: image came null from view
body: <p>I need to get a photo from the view and in the controller, but always comes null</p>
  
  <p>I need to get a photo from the view and in the controller, but it always comes null. I tried to download jpeg.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;div class="form-group"&gt;
          &lt;label asp-for="Avatar"&gt;&lt;/label&gt;&lt;br /&gt;
          &lt;input asp-for="Avatar" multiple&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>public async Task&lt;IActionResult&gt; Register(RegisterViewModel model)
          {
              if (ModelState.IsValid)
              {
                  User user = new User { Email = model.Email, FirstName = model.FirstName, LastName = model.LastName, UserName = model.Email, Address = model.Address };
  
                  using (var memoryStream = new MemoryStream())
                  {
                      await model.Avatar.CopyToAsync(memoryStream);
                      user.Avatar = memoryStream.ToArray();
                  }
                  var _result = await _userManager.CreateAsync(user, model.Password);
                  if (_result.Succeeded)
                  {
  
                      await _signInManager.SignInAsync(user, true);
                      //IdentityResult result = await _userManager.AddToRoleAsync(user, "User");
  
                      await _userRepository.SendConfirmEmailMessage(user.Email);
  
  
                      return RedirectToAction("Index", "Home");
                  }
                  else
                  {
                      foreach (var error in _result.Errors)
                      {
                          ModelState.AddModelError(string.Empty, error.Description);
                      }
                  }
  
              }
              return View(model);
          }
  </code></pre>
  
  <p>RegisterViewModel</p>
  
  <pre><code>public IFormFile Avatar { get; set; }
  </code></pre>
  
  <p>User</p>
  
  <pre><code>public byte[] Avatar { get; set; }
  </code></pre>