我正在用JQuery和PHP构建一个表单,一切似乎都正常,接受文件上传。Json似乎不喜欢$_FILES。当javascript关闭时,表单可以正常上传。这是一个已知的问题吗?如果是这样的话,有没有办法呢?JQuery插件是如何做到这一点的?
谢谢!
JQUERY:
$('#mcContactForm').submit(function(e){
e.preventDefault();
// validate form
mcValidateForm();
// serialize and submit form data
$('
无法成功地将图像/文件上载到服务器。php如下:
//This is the directory where images will be saved
$uploadDir = "./";
$uploadFile = $uploadDir . basename( $_FILES['photo']['name']);
//Writes the photo to the server
if(move_uploaded_file($_FILES['photo']['tmp_name'], $uploadFile)){