File system persimmon access with event.file.copyTo() on upload components

Hello,

I try to use event.file.copyTo("d:/alarms") in onFileReceived on upload components in Perspective Event but get the following error:

com.inductiveautomation.ignition.common.script.JythonExecException
Traceback (most recent call last):
File "function:runAction", line 2, in runAction
java.io.FileNotFoundException: java.io.FileNotFoundException: D:\Alarms (Access is denied)

caused by org.python.core.PyException
Traceback (most recent call last):
File "function:runAction", line 2, in runAction
java.io.FileNotFoundException: java.io.FileNotFoundException: D:\Alarms (Access is denied)

caused by FileNotFoundException: D:\Alarms (Access is denied)

Ignition v8.1.12 (b2021111810)
Java: Azul Systems, Inc. 11.0.11

I try to change security to the D drive and alarms folder but it doesn't work.
Thanks for any help.

What do you mean you tried to change security? From what to what? (The security needed is the permissions for the user account running the gateway services. Which is a local system account by default, not a regular user.)

In windows I change the permission to full control.

Hmmm. Your .copyTo() as shown is just a folder name. You need to supply a complete file name. One of your own posts is an example: