Message
UnauthorizedAccessException: Access to the path '...' is denied.
Context
Executing the following line of code (C# ASP.NET under Visual Studio, localFile or UNC path)
FileStream fs = new FileStream(fileName, FileMode.Open);
Explanation
ND
Solution
Add the fileaccess mode option "FileAccess.Read":
FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
Add the fileaccess mode option "FileAccess.Read":
FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
Thank you!
ReplyDeleteYou're welcome
DeleteThank you for sharing great solution...
ReplyDeletebest web development services| affordable seo services