Null FileStream CSOM

developer sp1 461 Reputation points
2020-08-03T06:54:54.327+00:00

In SharePoint Remote Event Receiver, I'm try to get file stream from a ListItem:

List docs = clientContext.Web.Lists.GetById(listId);
ListItem item = docs.GetItemById(listItemId);
clientContext.Load(item);
clientContext.ExecuteQuery();
var file = item.File.OpenBinaryStream();

But it's returning null, is this limitation in Event Receiver ? I used to use this code in Console, it's working.

Please help to resolve it.

SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,607 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jerryzy 10,571 Reputation points
    2020-08-04T01:35:31.757+00:00

    Hi @developer1-9584,

    Please try to get the file stream like the code as attachment.

    15352-getfilestream.txt

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.