MIME (ContentType) causes an ASP to receive XML data from Flash Post

xiaoxiao2021-03-06  41

Yesterday, I met a very troublesome question. It was long ... Because I prefer to use MM's XMLConnector components, but the company used the MX platform, I had to write a MX version of the XMLConnector component. The code is basically copied from the original 2004 component and then modifies some places for MX. After doing well, test all OK. When I really used it, I found a problem. If the URL is set to a dynamic web page (ASP), it is normal to test in the IDE environment, and the ASP does not receive the data transferred by Flash! Of course, there is no problem, not the reason for the ASP does not run. Why can I use it in the IDE? Can you use it outside? Best can't understand. Google, finally found the reason, an AS in the component is changed to "text / XML" to "Text / XML" and send it out. The default XML contentType is "Application / X-WWW-FORM-URLENCODED", so ASP can receive data in form, otherwise Request.form is empty. As for the MM's component, why should I change ContentType to Text / XML? There should be his reason, but when this is used to receive Request.form, what? In fact, use the request itself, it can be used to support binary reading as long as reading. Such as:

<%

DIM XMLDOC

Set Xmldoc = Server.createObject ("msxml2.domdocument.4.0")

XMLDoc.async = false

XMLDoc.Load (Request) 'Load method is binary reading, and LOADXML is a read string

XMLASSTRING = XMLDoc.xml 'use

%>

or:

<%

VAR XMLDoc = New ActiveXObject ("msxml2.domdocument.4.0");

Xmldoc.async = false;

XMLDoc.Load (Request); // Load method binary method Read request

XMLASSTRING = XMLDoc.xml;

%>

转载请注明原文地址:https://www.9cbs.com/read-82618.html

New Post(0)