Hello Everyone I am using angularjs to send byte array on server side but I am not getting data on server side. Here is my code.
$scope.Upload = function () {
var bytesToSend = [253, 0, 128, 1]
var send = new Uint8Array(bytesToSend)
var Upload = $.ajax({
type: 'POST',
url: "/UploadFile",
dataType: JSON,
contentType: false,
data: send,
success: function (send) {
toastr.success("Upload Successfully");
}
});
Upload.error(function () { console.log(bytesToSend+'gaurav') });
}
And here is my server side code
[HttpPost]
[Route("UploadFile")]
public bool UploadedFile(byte[] send)
{
return false;
//return await CenterGateWay.UpldFile(up);
}
}
I am not getting data in byte[] send it is showing null value. please anyone help where I am wrong And I am getting data in console here [253, 0, 128, 1]. Using firefox browser right now.