문제

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 think 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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top