Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
372 views
in CompleteFTP by (150 points)

I'm working on an event handler using JSS script. 

In it, I'm attempting to use getFiles() to build a file list.

var sourcePath = "/Home/<path>/" + user;

var sourceFolder = new File(sourcePath);

var fileList = sourceFolder.getFiles(); 

But I get this error. 
No folder-list permission for /Home/<path> (VirtualFilePermissionException): <script> (14, 0):

I've checked the permissions in the virtual directory and confirmed that the user triggering the script (on logout) is in the group that has full permissions. I've also tried using the "Grant permissions of" box in the event editor set to admin with the same error. 

Any ideas what else I could check?

1 Answer

0 votes
by (51.6k points)
selected by
 
Best answer

What's probably happening is that the logout event is triggered after the use has logged out, so the session is no longer authenticated at this point. Granting the user the permissions of another user that does have permissions should work, but there's a bug (that will be fixed in 23.1.0) that ignores the instruction to use another account if there's a session available. I'm sorry about this.

We can generally find an alternative solution for these sorts of things as there are usually several different avenues available. If you tell me your full requirements then I might be able to come up with a workaround for you. What are your full requirements?

by (150 points)
Thank you support. I answered in a followup question, but I'll put it here too.

My script needs to move all files at a path /Home/<path> to 3 different locations.

The user that's uploading the files is a different application. It logs on, uploads hundreds of files, then logs off.

When I tried running a trigger on each upload some files were left behind. My idea to correct that problem was to run on logout instead and just move anything in the directory.
by (162k points)
Please don't create new questions that are the same as previous questions. The fix to this will be in 23.1.0, which will be out in a few weeks. If you require a workaround, please open a support ticket here:
https://enterprisedt.atlassian.net/servicedesk/customer/portal/1
by (51.6k points)
As a workaround until a fix is released, perhaps you could use a scheduled trigger to periodically move any files that the directory?

Categories

...