简体   繁体   中英

Retrieve ajax formData on classic asp page?

I'm sending data with ajax to my asp classic page - with new FormData() and my alert shows [object FormData] so it should be right? But Im trying to display the variables "folderName" from my asp page in my success alert but it is not showing anything.

So how do I receive the formData on my asp page?

This is what I have now

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;
});

and in my asp page I just use 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>

I don't know why I can´t receive the variable on my asp page? Any input really appreciated, thanks.

try this for second asp file


<%
folderName = request.form("folderName")
%>
<%= folderName%>

line with

enctype: 'multipart/form-data' 

in first file have to be removed. You can not access multipart/form-data from asp without special libs...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM