13,721 questions
Add and list GenericList Item attachments
Marco
0
Reputation points
I need to add file attachment to a genericlist item .
On Graph api explorer I can see tha Item contains attacments but I cannot explore them.
And how can add attachment via Graph Api ? I can only do that via browser on the list item detail.
I try to do that
MemoryStream mem = ConvertBase64ToMemoryStream(attachmentFiletxt); //new MemoryStream(fileBytes);
var res = await _appClient
.Sites[siteId]
.Lists[listId]
.Items[itemId]
.DriveItem
.Content
.PutAsync(mem);
but the response is " Cannot request driveItem for an item that is not in a document library"
Is there another way to do that ?
thans
Microsoft Security Microsoft Graph
Sign in to answer