CFML2WDDX错误ColdFusion 11

地缘

我正在CFM2WDDX转换CF11中的数组,但出现此错误:

coldfusion.tagext.validation.WddxValidator $ InvalidWddxPacketException:无效的WDDX数据包。

我在这里使用此代码:

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的部分输出:

在此处输入图片说明

CF 11中的CFHTTP.Header:

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 

CF 9中的CFHTTP.Header:

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

地缘

我不确定是什么原因导致了此行为,但是我现在找到了中间立场。我没有通过cfhttp调用getFileList.cfm,而是将代码从getFileList.cfm中直接移到了函数内部,一切正常。使用该文件开头的原因是允许我访问不再需要/不再使用的其他服务器上的外部映像存储库。无论哪种方式,这实际上可能都是CF11错误,因此我们将在以后看到...

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章