我想传递其他参数与文件保存在database.when我把代码来获取这些变量并保存在数据库中它给我警报“SyntaxError:语法错误”... 这里是我的代码SyntaxError:语法错误ajaxFileUpload jquery插件
$.ajaxFileUpload
({
url:'popup/doc_mydeal.php',
secureuri:false,
fileElementId:'deals_documents',
dataType: 'json',
data:{rand_key: $('#rand_key').val(), document_name: $('#document_name').val()},
success: function (data, status)
{
if(typeof(data.error) != 'undefined')
{
if(data.error != '')
{
alert(data.error);
}
}
},
error: function (data, status, e)
{
alert(e);
}
})
现在在doc_mydeal.php
$tempFile = $_FILES['deals_documents']['tmp_name'];
$targetFile=$path.$_REQUEST['rand_key'].basename($_FILES['deals_documents']['name']);
move_uploaded_file($tempFile,$targetFile);
,这里是MySQL查询数据库中保存
在PHP方面的任何错误? – mkaatman 2013-03-06 16:05:35
错误在PHP,JS或其他地方? – robert 2013-03-06 16:05:54
你的dataType是'json',但你不返回任何东西。 – Musa 2013-03-06 16:06:27