我用ajax将数据发送到我的asp经典页面-使用新的FormData(),并且我的警报显示对象FormData,所以它应该是正确的?但我试图在成功警报中显示asp页面中的变量"folderName“,但它没有显示任何内容。
那么,如何在asp页面上接收formData呢?
这就是我现在拥有的
var formData = new FormData($$(page.container).find('#pdffile')[0]);
formData.append("folderName", "manmade");
myApp.alert(formData); //this shows [object FormData]
$$.ajax({
method: 'POST',
url: 'dokument/dokument2.asp',
//processData: false,
//contentType: false,
enctype: 'multipart/form-data',
data: formData,
success: function (data) {
myApp.alert(data)//I get nothing in the alert?
}
});
return false;
});在我的asp页面中,我只使用request.form!?
<%
folderName = request.form("folderName")
%>
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<%=folderName%>
</body>
</html>我不知道为什么我不能接收我的asp页面上的变量?任何投入都非常感谢,谢谢。
发布于 2016-01-03 01:25:39
为第二个asp文件尝试以下操作
<%
folderName = request.form("folderName")
%>
<%= folderName%>连成线
enctype: 'multipart/form-data' 在第一个文件中必须删除。如果没有特殊的库,则无法访问asp中的多部分/窗体数据.
https://stackoverflow.com/questions/34511512
复制相似问题