开发者

edit LDAP Photo attribute, spring-ldap InvalidAttributeValueException

I develop an LDAP interface program which can modify person attributes, but when I try to modify the value of the photo attribute with an url string, I have this exception :

org.springframework.ldap.InvalidAttributeValueException: [LDAP: error code 21 - photo: no validator for syntax 1.3.6.1.4.1.1466.115.121.1.23];

I thin开发者_Go百科k I must send a JPG photo file to ldap but I don't know how to do it...

Anyone has an idea?


First, when you encounter such an error with a syntax OID, you can submit it to the OID repository. Here it will give you the following information "Values in this syntax are encoded as if they were octet strings". This means that you have to encode your JPG or PNG file in Base64 and set the attribute with this value (in fact an array).

Second, in my understanding, there are 3 attributes to store photo-Data jpegPhoto, Photo and thumbnailPhoto. But for me it's better to store photos on a file system or a database and put in the Directory ans URL or something like that.

You'll find here a tutorial to handle them with java.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜