我使用CFM2WDDX
转换在CF11的数组,但我收到此错误:CFML2WDDX错误的ColdFusion 11
coldfusion.tagext.validation.WddxValidator$InvalidWddxPacketException: Invalid WDDX packet..
我使用这个代码在这里:
getFileList.cfm
<cfsetting enablecfoutputonly="Yes">
<cfset thisdir = ExpandPath(".\")>
<cfdirectory directory="#thisdir#" action="LIST" name="imagefiles" recurse="No">
<cfscript>
// get .gif|.jpg|.png files from the cfdirectory query...
numRows = imagefiles.recordcount;
imageFileArray = ArrayNew(1);
for (row = 1; row LTE numRows; row++) {
if (refindnocase("(.gif|.jpg|.png)",imagefiles.name[row]) neq 0) {
ArrayAppend(imageFileArray, imagefiles.name[row]);
}
}
</cfscript>
<cfwddx action="cfml2wddx" input=#imageFileArray# output="wddxText">
<cfoutput>#wddxText#</cfoutput>
正如你所看到的代码创建一个图像名称的数组,然后我通过cfhttp访问做我所需要的用它。我有一个相同的确切的代码与CF9服务器上的相同的确切目录内容和正常工作,但在CF11我得到格式错误。莫名其妙地改变了CF11的功能?
这是我使用访问上面的代码的代码:
<cfhttp url="http://example.com/images/ClientLogos/getFileList.cfm" method="GET" timeout="10" throwonerror="Yes">
<cfwddx action="WDDX2CFML" input="#trim(cfhttp.filecontent)#" output="imageArray" validate="true">
<cfreturn imageArray>
的getFileList.cfm
与图像相同的目录,因此执行本地服务器在正在从呼吁。 (这就是为什么我认为CF11可能是问题)从CF9输出的
部分:
而且从CF11的输出部分:
CFHTTP。来自CF 11的标题:
HTTP/1.1 200 OK Content-Type: text/html;charset=UTF-8 Server: Microsoft-IIS/8.0 X-Powered-By: ASP.NET Access-Control-Allow-Origin: * Date: Tue, 31 Mar 2015 18:50:35 GMT Connection: close Content-Length: 10807
CFHTTP.Header从CF 9:
HTTP/1.1 200 OK Content-Type: text/html; charset=UTF-8 Vary: Accept-Encoding Server: Microsoft-IIS/7.5 X-Powered-By: ASP.NET Date: Tue, 31 Mar 2015 18:51:20 GMT Connection: close
https://bugbase.adobe.com/ – Henry 2015-03-31 17:41:34
@Henry你是说我应该添加到bugbase或搜索它从类似的问题? – Geo 2015-03-31 18:04:34
如果您只是浏览到您的'getFileList.cfm'页面,它是否显示WDDX格式的数据?我只是在本地的CF9和CF11服务器上做了一个快速测试。两者都按预期工作。但是我没有执行'cfhttp'部分。我刚刚浏览了我的测试页。 – 2015-03-31 18:25:31