问题描述
我正在为Notes 8.5.2开发一个Lotus Notes插件,用于将附件从eMail保存到Harddisk。但是当我尝试从Notes文档中读取附件名称时,我总是得到包含第一个附件名称+一些垃圾数据的相同字符串。
I'm developing an Lotus Notes plug-in for Notes 8.5.2 that saves the attachments from an eMail to the Harddisk. But when I try to read the attachment names from a Notes document I always get the same string containing the first attachment name + some junk data.
protected Vector<String> getAttachmentNames() throws NotesException,
IOException {
Vector<String> attachmentNames = new Vector<String>();
Item item = null;
Enumeration<?> itemsEnum = mailDoc.getItems().elements();
while (itemsEnum.hasMoreElements()) {
item = (Item) itemsEnum.nextElement();
if (item.getType() == Item.ATTACHMENT) {
attachmentNames.add(getAttachmentNameOf(item));
}
}
return attachmentNames;
}
protected String getAttachmentNameOf(Item item) throws NotesException,
IOException {
return getAttachmentName(item.getValueString());
}
getAttachmentName只进行一些字符串格式化以生成唯一的文件名。
getAttachmentName only does some string formatting to generate a unique filename.
推荐答案
需要注意的事项。 MIME附件并不总是被识别为文档附件。因此,虽然您可以在Notes客户端中看到它,但您将无法以编程方式访问它。
Something to be aware of. MIME attachments are not always recognized as document attachments. So while you can see it in the notes client, you will not be able to programmatically access it.
以下技术说明详细介绍了它以及如何解决它。
The following tech note details it more and how to resolve it.
这篇关于Lotus Notes从文档中获取附件名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!