i am using asp classic in which i use recaptcha 2.0 when i used enctype="multipart/form-data" my image uploader work fine but recaptcha response is false and when i remove enctype="multipart/form-data" on form tag recaptcha work fine but not image uploader please help me
recaptcha method
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then Dim recaptcha_secret, sendstring, objXML
' Secret key
recaptcha_secret = "secret key"
sendstring = "https://www.google.com/recaptcha/api/siteverify?secret=" & recaptcha_secret & "&response=" & Request.form("g-recaptcha-response")
Set objXML = Server.CreateObject("MSXML2.ServerXMLHTTP")
objXML.Open "GET", sendstring, False
objXML.Send
Dim oJSON,jsonstring,result,data,success
Set oJSON = New aspJSON
result = (objXML.responseText)
Set oJSON = New aspJSON
oJSON.loadJSON(result)
Set objXML = Nothing
success = oJSON.data("success")
if success = "True" then
TestCaptcha ="True"
else
TestCaptcha ="False"
end if
Set objXML = Nothing
End If
You cannot use
Request.form("g-recaptcha-response")when posting a form withenctype="multipart/form-data", as the ``Request.Form`collection is not available.Instead, use your Upload component DLL property (usually
formtoo). For example, with the Persists ASPUpload component, use :You can then use your variable
myFormFieldto pass to Google ReCaptcha, like this :