# Error in copy file

**URL:** <https://forum.inductiveautomation.com/t/error-in-copy-file/12547>\
**Category:** Ignition\
**Created:** [January 11, 2017, 5:34pm UTC](https://forum.inductiveautomation.com/t/error-in-copy-file/12547 "2017-01-11T17:34:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrea.montresor](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@andrea.montresor](https://forum.inductiveautomation.com/u/andrea.montresor)\
**Post date:** [January 11, 2017, 5:34pm UTC](https://forum.inductiveautomation.com/t/error-in-copy-file/12547/1 "2017-01-11T17:34:11Z")

</div>

Hello,

I tried to run a script to copy some files from a directory to a ftp path.  
I tried this script in the “Interactive Script Tester” and it works:

```auto
import shutil, os, datetime, sys, traceback, binascii
	
shutil.copy2("D:\\SharedFolderSCADA\\2017\\01\\10\\Buffer - Belt 1 - 2017-01-10_10-34-59.dat","\\\TEST_FOLDER\\SharedFolderEVO\\2017-01-10\\Buffer - Belt 1 - 2017-01-10_10-34-59.dat")
```

This script copy the file from the folder in SCADA pc to the ftp path correctly.

When I try to put this script in a value changed of one tag, I have this error about the permission:

```auto
File "user-lib\pylib\shutil.py", line 96, in copy2
    copyfile(src, dst)
  File "user-lib\pylib\shutil.py", line 52, in copyfile
    fdst = open(dst, 'wb')
IOError: [Errno 13] Permission denied: '\\\\TEST_FOLDER\\SharedFolderEVO\\2017-01-10\\Buffer - Belt 1 - 2017-01-10_10-34-59.dat'
```

I think is a permission in a value change or something like this, but I don’t know how to solve. The script works in the tester script of the designer, but not works in the value change.  
I have to run this script periodically, every 5 minutes.

Could you please help me?

Thanks  
Andrea

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 11, 2017, 6:55pm UTC](https://forum.inductiveautomation.com/t/error-in-copy-file/12547/2 "2017-01-11T18:55:49Z")

</div>

Read through [this old topic](https://inductiveautomation.com/forum/viewtopic.php?f=50&t=11144).  
Tag events run in the gateway, not in the designer or client, so you must have the network shares and permissions set up for the Ignition Service itself.
