Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Cannot access file JST-310042 Access to file is forbidden

johanna_m
Level 2
Level 2

I have a simple javascript code, trying to access folder files

var path = "C:\\Processing\\"

var directory = new File(path)

var files = directory.list("*.*")

vars.feedCount = files.length

I am getting a forbidden error

1725583_pastedImage_2.png

1 Accepted Solution
David__Garcia
Correct answer by
Level 9
Level 9

By default this option is not available OOTB, you must navigate to  Administration\Platform\Options and create the option, set the data type to integer and the value to 1. This will allow you to access files from folders outside the permitted folders (var,sftp temp)

As per documentation https://docs.campaign.adobe.com/doc/AC/en/INS_Appendices_Configuring_Campaign_options.html

XtkSecurity_Disable_JSFileSandboxing

If 1 is selected, this option disable the file sandboxing withing Javascript.

1726263_pastedImage_0.png

View solution in original post

0 Replies
geoffreyl240454
Level 4
Level 4

Hi Johanna,

This code is working on my side.

I think that you must control the rights granted to this folder.

Thanks,

Geoffrey.

ramon_bisswanger
Employee
Employee

There was a change in 8947 on file access for new installations.

It also states option  XtkSecurity_Disable_JSFileSandboxing to disable new handling

See https://docs.campaign.adobe.com/doc/AC/en/RN.html

David__Garcia
Correct answer by
Level 9
Level 9

By default this option is not available OOTB, you must navigate to  Administration\Platform\Options and create the option, set the data type to integer and the value to 1. This will allow you to access files from folders outside the permitted folders (var,sftp temp)

As per documentation https://docs.campaign.adobe.com/doc/AC/en/INS_Appendices_Configuring_Campaign_options.html

XtkSecurity_Disable_JSFileSandboxing

If 1 is selected, this option disable the file sandboxing withing Javascript.

1726263_pastedImage_0.png

View solution in original post

Jonathon_wodnicki
Community Advisor
Community Advisor

Hi,

 

If you want to keep the sandboxing while also allowing access to that folder, set <dataStore extraSandboxedDirectories="C:\Processing"/> in instance conf:

 

Thanks,

-Jon