$.post('image.php', {
image:form.image.value
}
<form id="form" enctype="multipart/form-data">
<input type="file" id="image" name="image"/>
PHP->isset($_FILES['file'])
如何使用$.post()
在表单标签内部提交$_FILES
?
我是否仍需要包含enctype
或者需要使用AJAX,如何实现?
$.post('image.php', {
image:form.image.value
}
<form id="form" enctype="multipart/form-data">
<input type="file" id="image" name="image"/>
PHP->isset($_FILES['file'])
如何使用$.post()
在表单标签内部提交$_FILES
?
我是否仍需要包含enctype
或者需要使用AJAX,如何实现?
$('#form').ajaxSubmit({
success: function(response) {
console.log(response);
}
});
在PHP中
// after doing upload work etc
header('Content-type: text/json');
echo json_encode(['message' => 'Some message or param whatever']);
die();