Hi,
I have a form where users are able to upload images to the website. The images are stored, binary, in the table. I use ajax and jquery on the site and it is never reloaded so when a users enter the data and push submit the page is not reloaded instead I use ajax to upload the the data to the server.
When i just passthrough text it looks like this:
$("#storeDataAndImgBtn").bind("click", function () {
var msg = $("#emailMsg").val();
var from = $("#fromEmail").val();
$.ajax({
type: "POST",
url: "Default.aspx/storeDataAndImg",
data: "{\"from\":\"" + from + "\" ,\"msg\":\"" + msg + "\" ,\"value\":\" 'image should be here' \" }",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (temp) {
alert(temp.d);
$("#mailForm").fadeOut(function () {
$("#overlay").fadeOut();
});
}
});
return false;
});
My question is how i can passthrough the image so that I can store it in the database?