function UpdateUserDetails()
{
var title = $("#title1").val();
var store = $(".search-box").val();
var category= $("#category").val();
var descp=$("#descp1").val();
var price=$("#price1").val();
var value=$("#value1").val();
var location=$("#location1").val();
var url=$("#url1").val();
var id = $("#hidden_user_id").val();
$.post("update.php", {
id: id,
title:title,
store:store,
category:category,
descp:descp,
price:price,
value:value,
location:location,
url:url
},
function (data, status) {
$("#update_user_modal").modal("hide");
}
);
}
The above is my code where it fetches values from html form and then sends to update.php file. How can i send a image file through this function along with all the variables? should i send it as file itself or by encoding it? Help me out!!