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