0 Replies Latest reply on Mar 21, 2007 3:07 PM by VinceFromNH

    CFLDAP uploading/replacing Image (binary)

      I have been unable to find any other person on the Web that has posted about this. I'm hoping that someone here might have a suggestion or two.

      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"

      The resulting error: "ByteArray objects cannot be converted to strings."

      If I change the above to
      it is redundant and causes the same error.

      I can update the field without error if I do this:

      This takes the update but it stores it as a text attribute. I have read some non-ColdFusion blogs talking about flagging the update with a switch like "...;binary" or "::binary" but putting that at the end like this:
      just inputs those additional characters in the field.

      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!