Mam następujący kod:SharePoint: Jak programowo dodać załącznik do elementu listy?
SPList list = web.Lists[this.ListName];
SPListItem item = list.Items.Add();
teraz to, co chcę zrobić, to:
FileInfo[] attachments = attachmentDirectory.GetFiles();
foreach (FileInfo attachment in attachments)
{
// Add the attachment from file system to the list item...
}
Jak przekonwertować normalny plik do tablicy bajtów?
Dzięki obie te metody są zbyt ostry. Znalazłem inny sposób na zrobienie tego –