Forum Discussion
Sajith G H
Jan 29, 2018Brass Contributor
Error in uploading the document from the network file share to Office 365 document library.
Getting the following error when the console application try to upload the document from the file share to Office 365 document library.
Unhandled Exception: System.UnauthorizedAccessException: ...
Jan 29, 2018
Well, the error says that the problem is on the File Share side and not in SPO...does the application have the required permissions to read information from that path?
- Sajith G HJan 30, 2018Brass Contributor
Yes. The console application is running on my user login and has full permission. Still I get the error in FileMode.Open
using (FileStream o365FileStream = new FileStream(o365FilePath, FileMode.Open))
{
Microsoft.SharePoint.Client.File.SaveBinaryDirect(o365Context, o365ServerRelativeUrl, o365FileStream, true);
}- DeletedFeb 15, 2018
Not sure it relates, but I had this same error trying to run a program, very recent security update that caused this issue for me. When I right click and 'Run as Administrator' the problem disappeared.