Old user icon not removed after updated with REST API


I am uploading user icons through REST API.

It works as expected and on first run I get my 1170 files in tenant work/icons/users directory.

The problem is when I run a second time my job. All the icons get duplicated on disk... The old user icon should be deleted when it is updated.

The REST calls I am using:
* /loginservice to get a session
* /API/User/identity to search user by username
* /portal/imageUpload to send the picture and store the result as newFilename. The multipart POST data only contain the picture binary content
* /API/User/identity/userid : PUT with JSON { "icon": "newFilename" }

Did I miss something? Is there a way to force delete an icon through a REST API I am not aware of? The portal do remove the old icon.

1 answer

This one is the BEST answer!

No way to do that, I would submit a bug report for ALL upload servlets using REST.

This is just like any other CRUD operation and should be programmed as such.


PS: If this reply answers your question, please mark a resolved.


Submitted by g.lapierre on Mon, 04/25/2016 - 16:39

Created BBPMC-377 on your advice.