Skip to Content
Author's profile photo Armando Zaro

How to properly read Picture file to upload to UME as User Photo – NW 7.31/7.40

Hello everyone

As you might know, since NW 7.31 it is possible to display the user photo of the initiator of a BPM Task, in the Stream View of BPM Inbox. It shows as it follows:


The photo which is shown is stored in the UME (User Management Engine).

On NW 7.31 and NW 7.40, the NetWeaver only provides the APIs to set the photo for each user, but does not provide a shipped UI in order to upload such a photo.

As of NW 7.5, the /useradmin application already have a User Interface to upload the photo for each user.

For NW 7.31 and NW 7.40, according to BPM Inbox documentation, a custom application can be developed to make the upload on versions prior to NW 7.5. This is stated at:

It’s important to mention that the method setPhoto described in this documentation receives as a parameter a byte array (byte[]).

Here is an example on how to retrieve a correct byte[] from an image residing in the file system:

File file = new File(“C:\\<path>\\<to>\\<photo>”);

byte[] buffer = new byte[4096];

ous = new ByteArrayOutputStream();

ios = new FileInputStream(file);

int read = 0;

while ((read = != -1) {

      ous.write(buffer, 0, read);


byte[] fileContent = ous.toByteArray();

After filling the fileContent variable with the resulting byte array, it can be passed as a parameter to the method setPhoto of the IUserMaint class object that you create.

In case the conversion to byte array is not properly made, the image might get corrupted and as a result the photo might not get displayed, and the following symbol is displayed instead:


Have that in mind in case you develop a custom UI and your photo is not appearing in BPM Inbox.


Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.