House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

CFLDAP uploading Image (binary)

  << Previous Post |  RSS |  Tree View |  Sort Oldest First |  Subscribe to this Group Next >> 

CFLDAP uploading Image (binary)

Thanks Oblio, Vince Collins (NHJobs.com) 03/21/2007 10:49 AM
I can't offer any help with LDAP, but if your LDAP server can receive Leitch, Oblio 03/20/2007 03:42 PM
I've hit a wall and have a question. Vince Collins (NHJobs.com) 03/20/2007 03:21 PM

03/21/2007 10:49 AM
Author: Vince Collins (NHJobs.com) Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50893#273264 Thanks Oblio, I have tried toBinary() which I'm assuming does the same thing but maybe I'm wrong. I have had limited success with toBase64() which is what LDAP is supposedly encoding it as.  It allows me to update the field but when browsing the attributes, it stores it as a text attribute and not a binary like all the other photos are stored for other profiles.  When displaying it it just shows a broken image. I've come across some non-ColdFusion articles that talk about a ";binary" switch needing to be passed to LDAP but so far I have not been able find a way to do this with CFLDAP. I see lots of online examples of how to display an image using CFLDAP which is nice.  It's just hard to believe that no one else has had to *update* an image using CFLDAP. Anyone have any other ideas? -Vince Leitch, Oblio wrote: ----- Excess quoted text cut - see Original Post for more -----
03/20/2007 03:42 PM
Author: Leitch, Oblio Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50893#273187 I can't offer any help with LDAP, but if your LDAP server can receive data in another way, you can use binaryEncode(data, ["hex","base64"]). Oblio I've hit a wall and have a question. I have been able to write a form that allows the updating of all text fields within the LDAP directory using cfldap.  What I need now is to provide the ability to upload an image and store that within LDAP. Here is where it breaks.   <!--- upload file --->   <cffile action="upload" filefield="seljpegPhoto" destination="#root#\update\upload" nameconflict="makeunique">   <!--- read file as binary --->   <cffile action="READBINARY" file="#root#\update\upload\#file.serverfile#" variable="BinaryImageContent">   <!--- Replace with new image --->   <cfldap action="modify"            DN="#qry_get_one_emp.distinguishedName#"            attributes="jpegPhoto=#BinaryImageContent#"            modifytype="replace"            server="#LDAPServer#"            username="#LDAPUsername#"            password="#LDAPPassword#"> The resulting error:  "ByteArray objects cannot be converted to strings." If I change the above to   attributes="jpegPhoto=#ToBinary(BinaryImageContent)#" it is redundant and causes the same error. Is there some switch I am missing or something else I need to do in order to let CFLDAP know this is binary and to allow the update?  I have found NO information on how to upload a binary object into LDAP using CFLDAP. Any help would be greatly appreciated! Vince
03/20/2007 03:21 PM
Author: Vince Collins (NHJobs.com) Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50893#273185 I've hit a wall and have a question. I have been able to write a form that allows the updating of all text fields within the LDAP directory using cfldap.  What I need now is to provide the ability to upload an image and store that within LDAP. Here is where it breaks.   <!--- upload file --->   <cffile action="upload" filefield="seljpegPhoto" destination="#root#\update\upload" nameconflict="makeunique">   <!--- read file as binary --->   <cffile action="READBINARY" file="#root#\update\upload\#file.serverfile#" variable="BinaryImageContent">   <!--- Replace with new image --->   <cfldap action="modify"            DN="#qry_get_one_emp.distinguishedName#"            attributes="jpegPhoto=#BinaryImageContent#"            modifytype="replace"            server="#LDAPServer#"            username="#LDAPUsername#"            password="#LDAPPassword#"> The resulting error:  "ByteArray objects cannot be converted to strings." If I change the above to   attributes="jpegPhoto=#ToBinary(BinaryImageContent)#" it is redundant and causes the same error. Is there some switch I am missing or something else I need to do in order to let CFLDAP know this is binary and to allow the update?  I have found NO information on how to upload a binary object into LDAP using CFLDAP. Any help would be greatly appreciated! Vince
<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference