'How to crop image using croppie js and upload in asp.net core
I use coppie js in asp.net core 6 but when sned models item blob is null send to my controller but a few data send it is ok?? plz help me that why can not send more data to controller?
$('#btnupload').on('click', function ()
{
event.preventDefault();
var btn = $(this);
var $form = btn.closest("form");
basic.croppie('result', 'blob').then(function (blob)
{
var myform=$('#frmData')[0];
var formData = new FormData(myform);
formData.append('filename', 'FileName.jpeg');
formData.append('blob', blob);
var myAppUrlSettings =
{
MyUsefulUrl: '@Url.Action("Create", "ItemCategory")'
}
var request = new XMLHttpRequest();
request.open('POST', myAppUrlSettings.MyUsefulUrl);
request.send(formData);
request.onreadystatechange = function () { // Call a function when the state changes.
if (this.readyState === XMLHttpRequest.DONE && this.status === 200)
{
var response = JSON.parse(request.responseText);
if (response.message == "OK")
{
}
}
}
});
});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
