I have the following code to download a file by using its absolute path but the problem is that the stream I get is System.Io.Stream.NullStream.
If I modify the path I get the error:
"The remote server returned an error: (404) Not Found."
which means that the path that I'm using is correct.
I also tried removing the s from the https:// but its the same. Do you have any ideas what am I missing to get the file?
Sub Main()
Dim filename As New Uri("https://server/content/00008576/Project%20Documents/Workproductslist.xlsx")
Dim server As String = filename.AbsoluteUri.Replace(filename.AbsolutePath, "")
Dim serverrelative As String = filename.AbsolutePath
Dim clientContext As New Microsoft.SharePoint.Client.ClientContext(server)
Dim f As Microsoft.SharePoint.Client.FileInformation = Microsoft.SharePoint.Client.File.OpenBinaryDirect(clientContext, serverrelative)
End Sub