node-ldapjs
node-ldapjs copied to clipboard
Is possible to write the binary field jpegPhoto, adding a ldap entry?
I want to make a ldap add with a binary field how do I set it on the entry?
var entry = { uid: 'lalala', jpegPhoto: '{{ img content data in BASE64 }}' ldap_client.add(dn, entry,function (err) { ... });
this do not work :(
I already try
var imgBase64 = '/9kljnfkjsdnf.......==';
.......
var userPhoto = new Buffer(imgBase64);
also try
var userPhoto = new Buffer(imgBase64, 'base64');
also try
var userPhoto = new Buffer(imgBase64, 'binary');
.....
var entry = { uid: 'lalala', jpegPhoto: userPhoto };
ldap_client.add(dn, entry,function (err) {
...
});
all did not work :(
PS: What I need is to add a new entry on ldap with the jpegPhoto filled with a image-src
like <img ng-src="{{'data:image/png;base64,'+main.user.jpegPhoto}}">
from a LDAP jpegPhoto property
@augcampos Have you found any solution ?
@augcampos var userPhoto = new Buffer(imgBase64, 'base64');
would work fine with this PR: https://github.com/mcavage/node-ldapjs/pull/383
👋
On February 22, 2023, we released version 3 of this library. As a result, we are closing this issue/pull request.
Please see issue #839 for more information, including how to proceed if you feel this closure is in error.