The code is running under the Application server user, and if this may not be the same as your current authenticated user. Check to see if your Application server is running as a service, and that service user has access to the folder/file you are pointing to.
1 Like