I am trying to do.


Always get "forbidden" and unauthorized.

However If i use same context and url to do web.getFileByServerRelativeUrl() it works as expected.

That assures me, it should not be context or url issue.

Has anyone encountered this before?

1 Answer 1


According to SharePoint 2013 Online App: 403 Response While Downloading Documents from a Document Library article this error occurs when using oAuth App authentication model since Microsoft.SharePoint.Client.File.OpenBinaryDirect method doesn't pass App token

The solution is to use Microsoft.SharePoint.Client.File.OpenBinaryStream method instead as demonstrated in the same article.

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .