Daniel,
The way I solved this is by adding some code to the querySaveDocument event that checks if a new file was uploaded to a specific RichText Item and removes the existing one if needed.
Mark
Sample SSJS code in the querySaveDocument event :
//check if a new file was uploaded and if one already existed (and replace the existing one)
var RTITEM = "logo";
var strExistingFileName = null;
var newFileUploaded = false;
var attachments = currentDocument.getAttachmentList(RTITEM);
var it = attachments.iterator();
while( it.hasNext() ) {
var att = it.next();
if (att.getState().equals(com.ibm.xsp.model.domino.wrapped.DominoDocument$AttachmentValueHolder.STATE_ADDED) ) {
newFileUploaded = true;
} else if (att.getState().equals(com.ibm.xsp.model.domino.wrapped.DominoDocument$AttachmentValueHolder.STATE_INDOCUMENT) ) {
strExistingFileName = att.getName();
}
}
if (newFileUploaded && strExistingFileName != null) {
var att = currentDocument.getDocument().getAttachment(strFileToRemove);
att.remove();
}