I have converted the image that I upload through jQuery into base64 byte array/String.
With the help of code :
function readImage(input) {
debugger;
if (input.files && input.files[0]) {
var FR = new FileReader();
var a = null;
FR.onload = function (e) {
array = e.target.result;
};
FR.readAsDataURL(input.files[0]);
}
I am now passing the array through json to my web Api and having problem.
My json call is like:
$.getJSON('api/TestImage' + '/' + JSON.stringify(array))
.done(function (data) {
//doSomething
});
My action is :
public IHttpActionResult TestImage(String id)
{
return Ok(id);
}
So can any one tell what is the problem and what need to be done.
Thanks in advance..