Question - Forbidden error when trying to OpenBinaryStream
See original GitHub issueHello,
2 weeks ago I asked about how to reproduce Weblogin Method that was in the old PnPLivrary (Issue #79). You send us a workaround using some classes from PnP Powershell. I’m trying to load a file using OpenBinaryStream but when we access to the file we received an error “Forbidden”
Have you an idea of what can can be done in order to make it work?
Thank you
using ( var ctx = GetWebLoginClientContext( "https://my.sharepoint.com", true ) )
{
var fi = ctx.Web.GetFileByServerRelativeUrl( "/teams/Demo/Test.xlsx" );
ctx.Load( fi );
ctx.ExecuteQuery(); // System.Net.WebException: The remote server returned an error: (403) Forbidden.
fi.OpenBinaryStream();
ctx.ExecuteQuery();
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (8 by maintainers)
Top Results From Across the Web
Can't Open Binary Stream of file on Sharepoint Documents
1 Answer. Solution: Use OpenBinary Instead. "The problem was stemming from the use of the Microsoft. SharePoint.
Read more >OpenBinaryStream does not exist SharePoint file ...
The code is working fine SharePoint online file and getting the error Method "OpenBinaryStream" does not exist for the SharePoint 2010 ...
Read more >What Is the 403 Forbidden Error and How to Fix It (8 ...
You might encounter the 403 forbidden error when you visit an empty website directory or a specific page that has a permission error....
Read more >c# - Sharepoint error: OpenBinaryStream throws an error
The program returns an error at the ExecuteQuery() and tells me that there is no OpenBinaryStream() method. I tried to swap the two...
Read more >How to Fix a 403 Forbidden Error on Your Site
The 403 Forbidden error indicates that the server understands the request but can't provide additional access. This means that the web page you' ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I will investigate about these 2 calls and keep you informed.
Fiddler was shared with custom code that, after fixing, works in my lab. Also worked to load a web title for @DenisRouge , so closing this issue here