This commit is contained in:
2021-06-22 10:05:59 +01:00
parent 558be9063f
commit e40ff8a7f2
50 changed files with 899 additions and 184 deletions
@@ -148,7 +148,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
if (model.AccountContactImage.Count != 1)
{
SaLogger.Warn(fn + " Invalid number of image files uploaded: " + model.AccountContactImage.Count);
return Json(responseData.SetControlError("AccountContactImage", "Only one image can be uploaded."));
return Json(responseData.SetControlError("AccountContactImage", Localiser["msg.upload.image.single"]));
}
IFormFile file = model.AccountContactImage[0];
@@ -163,7 +163,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
// Validate the image.
ImageUtils.ImageConfig imageConfig = ImageUtils.VerifyImageData(imageData);
if (!imageConfig.ValidImage)
return Json(responseData.SetControlError("AccountContactImage", "Invalid image file uploaded."));
return Json(responseData.SetControlError("AccountContactImage", Localiser["msg.upload.image.invalid"]));
// Image belongs to the user's account.
ItemId userItemId = GetUserItemId(SessionData.User.UserAccountId);