i have made a form that will be send a input type file, in my server side i want to get $_FILES
value so i used print_r($_FILES)
, but in my ajax response i don't get anything value, here my code..
$('#my_form').submit(function() {
var data = $('#my_form').serialize();
$.ajax({
url: 'ajax.php',
type: 'POST',
data: data,
enctype: 'multipart/form-data',
success: function(response) {
alert(response);
},
});
return false;
});
and here my php code
$name = $_FILES['image_file']['name']; // get the name of the file
$type = $_FILES['image_file']['type']; // get the type of the file
$size = $_FILES['image_file']['size'];
echo $name;
//or
print_r($_FILES);
?>
please help me ...
thanks..
No comments:
Post a Comment