I hava a java script function in my JSP page
function submitProductCategoryForm()
{
document.getElementById('isSave').value="1";
var elements=document.getElementById('addProductCategoryFrom').elements;
var url = "addProductCategory.jsp?";
for (var i = 0; i < elements.length; i++)
url += elements[i].id + "=" + encodeURIComponent($("#" + elements[i].id).val()) + "&";
$.post(url, function(data)
{
alert("Function Complete");
});
}
It call a jsp page and here I saved the data in DB.
Now on this form there is a file input is also there, so it must be to set the content type to multipart/form-data
but when i call this function i found the error that
java.io.IOException: Posted content type isn't multipart/form-data
my form is like this
<form action="addProductCategory.jsp" method="post" enctype="multipart/form-data" id="addProductCategoryFrom">
So please how i set the content type to multipart.
thanks in advance