I have a jquery function:
$.ajax({
type: "POST",
url: "submit.php",
contentType:'multipart/form-data',
data: $('#regForm').serialize(),
dataType: "json",
its work perfectly but image and files will not be send by this. how can I resolve it?
You cannot upload files directly with Ajax, but you can use an hidden iframe, and send form data using the
target="iframe_name"attribute in<form>, see this tutorial: http://www.coursesweb.net/ajax/upload-images