Иногда пользователи не могут загрузить изображения через HTML-форму. Согласно журналам, я получаю следующие ошибки:
- Microsoft_DefaultRuleSet-2.1-General-200002
details_matches_s: [{"matchVariableName":"ParseBodyError","matchVariableValue":"1"}] - Microsoft_DefaultRuleSet-2.1-General-200003
details_matches_s : []
Форма:
Код: Выделить всё
Browse to an image on your computer and then click the Upload button.
Image formats supported: .png and .jpg
Optimal pixel height for logo: @Model.OptimalHeightInPx
[list]
[*]Supports smaller images
[*]
Please note: Logos smaller than the optimal size will not be resized.
[*]We recommend .png at 300dpi for best quality
[/list]
@Model.Title
Browse...
No file selected
Код: Выделить всё
[HttpPost]
public RedirectResult SaveWebsiteLogo(HttpPostedFileBase image)
{
// omitted for brevity
}
Код: Выделить всё
//trigger click of hidden input
$("body").on('click', '#uploadButton', function (e) {
e.preventDefault();
$('#image').click();
});
$("body").on('change', '#image', function () {
populateSelectedFileName();
});
Подробнее здесь: https://stackoverflow.com/questions/791 ... -200003-vi