Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Is possible to write the binary field jpegPhoto, adding a ldap entry? #359

Closed
augcampos opened this issue Mar 16, 2016 · 4 comments
Closed
Labels

Comments

@augcampos
Copy link

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 :(

@augcampos
Copy link
Author

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 augcampos changed the title Is possible to write the binary field jpegPhoto in a entry? Is possible to write the binary field jpegPhoto, adding a ldap entry? Mar 17, 2016
@feraudet
Copy link

@augcampos Have you found any solution ?

@feraudet
Copy link

@augcampos var userPhoto = new Buffer(imgBase64, 'base64'); would work fine with this PR: #383

@jsumners
Copy link
Member

👋

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.

@ldapjs ldapjs locked as resolved and limited conversation to collaborators Feb 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants