7
我使用现有的Active Directory信息创建公司目录。我能够提取所需的所有数据,但我也想使用Active Directory作为照片。如何使用ColdFusion显示Active Directory jpegPhoto?
我发现这个代码片段在这个博客:http://plus10.blogspot.com/2008/02/coldfusion-cfldap-display-images-stored.html
<!--- imageFile.cfm --->
<cfsilent>
<cfldap action="QUERY"
name="ldap"
attributes="jpegPhoto"
start="dc=[yourdc],dc=com"
filter="sAMAccountName=[loginname]"
server="[yourserver]"
username="[username]"
password="[password]">
<cfscript>
ldapPhoto = toString(ldap.jpegPhoto);
ldapPhoto = binaryDecode(ldapPhoto,"base64");
</cfscript>
</cfsilent><cfcontent type="image/jpeg" variable="#ldapPhoto#">
<!--- to display the image on a page --->
<img src="imageFile.cfm" width="100" height="125" alt="">
我在我所有的服务器数据堵塞,我得到的错误
的形象” ...... imagefile.cfm “无法显示,因为它包含错误
为什么图像不显示?以及如何更正代码?
我对查询做了<cfdump>
,它只是显示为“jpegPhoto”而非二进制数据。
我无法发布实际页面,因为它只在内部网络上。
Nevermind!我更换了所有的代码(除查询)与 –
你能可以继续并发布一个“答案”(这是允许的)。这样,对于有同样问题的其他人来说,这一点将更加明显。另外,人们也可以投票。 – Leigh