How to save a file with a long file path in SharePoint Server (on premise)

Sivilla, John 0 Reputation points
2024-04-24T15:35:28.8333333+00:00

I am trying to download and stream files contained in a SharePoint document library that contain long file paths.

I am trying something like this:

Microsoft.SharePoint.Client.File.OpenBinaryDirect(context, ServerRelativeUrl)

but I get an 500 Internal Server Error.

The file gets downloaded when I try to download through the SharePoint interface, so there is a way to access the file... How can we do this in code?

Thanks.

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,227 questions
{count} votes