Быстрый вопрос о SharePoint .... Мне нужно обновить вложение в списке с помощью SharePoint SDK, но когда я удаляю старый и добавляю новый, новый документ никогда не добавляется.Ниже мой код ...
/* Delete the attachment first and create a new attachment.*/
string fileName = newAttachmentName.Substring(0, newAttachmentName.IndexOf("."));
//Delete Attachment
SPAttachmentCollection attachments = item.Attachments;
if (item.Attachments != null)
{
string oldfilename = attachments[0].ToString();
attachments.DeleteNow(oldfilename);
item.Update();
}
//AddAttachement(item, newAttachmentName, attachmentStream, true);
attachments.Add(newAttachmentName, contents);
////attachments[0] = filename;
item.Update();