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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.