CF循环浏览本地目录中的图像并以 HTML 格式显示



我是ColdFusion的新手,我正在尝试从PC的网络目录中提取图像文件并将它们显示在HTML表中。这就是我目前所拥有的——

<cfdirectory action="list" directory="#ExpandPath('file://///network/path/Share-Install/path')#" name="listRoot">
<cfoutput>
<cfloop query="listRoot">
// Build HTML table here maybe?
</cfloop>
</cfoutput>

如果这段代码是正确的,我不清楚如何处理从文件/循环带回的数据。就像我说的,我现在才开始使用ColdFusion,所以我感谢任何建议!

我使用了错误的方法,最终通过使用<cfimage>得到了我想要的结果。 这是我的代码,它循环遍历我的目录并在 HTML 表中显示图像 -

<cfdirectory action="list" directory="C:Share-Install55555" name="listRoot" filter="*.jpg">
<table width="100%">
<tr>
<cfloop query="listRoot">
<tr>
<td ><cfimage action="writetobrowser" source="/Share-Install/55555/#name#" width="300"></td>
</tr>
</cfloop>
</tr>
</table>

最新更新