我有一個查詢從Oracle DB中檢索數據。我正在檢索的表包含一個BLOB類型的列。當我試圖輸出它爲在Coldfusion中顯示BLOB對象
<cfoutput>#query.blobColumn#</cfoutput>
它給我的錯誤「ByteArray對象不能轉換爲字符串」。我嘗試使用
<cfoutput>#ToString(query.blobColumn)#</cfoutput>
然後它工作,但我得到的內容爲「 t 」。
有什麼辦法可以顯示一些文本的blob(XML文件),如果用戶點擊它,我們可以顯示/下載它的全部內容?
這是我使用
<cfloop query="UpdateResult">
<tr id="dataRow">
<cfloop index="ColName" `list="#UpdateResult.ColumnList#">
<cfif isBinary(UpdateResult[ColName[UpdateResult.CurrentRow])>
<td>#CharsetEncode(UpdateResult[ColName][UpdateResult.CurrentRow], "ISO- 8859-1") #</td>
<cfelse>
<td>#UpdateResult[ColName][UpdateResult.CurrentRow]#</td>
</cfif>
</cfloop>
</tr>
</cfloop>`
字符是否出現在頁面上? – mwcz 2009-12-01 18:17:54
是的,我顯示在表格格式我得到了這個輸出 – CFUser 2009-12-01 18:31:55