<cfdirectory
action="list"
directory="\\uncPath\test"
sort="directory ASC"
name="resultQry"
/>
Result (in CF error object): access denied (java.io.FilePermission \uncPath\test read) null
I found this article: http://coldfusion-tip.blogspot.in/2012/02/file-write-operation-on-shared-path-on.html (from coldfusion-tip.blogspot)
Which mentions that you need to provide the main Coldfusion Service account that's running, a service account that has access to whatever network location you're trying to access. So I did that, I added AD group permissions (which included access to \uncPath\test) to a separate service account, and am using that instead of the default local service account for the CF Application Service.
I verified that the account does indeed have access to this location, by logging into another machine and navigating to the path in Windows. Wrote a test text file and moved there to verify that I had both read/write access.
I tried my code again (the CFDIRECTORY) call, and it fails with the same error as before.
If I try to access the same path with an absolute path which is the same location as the UNC path, it works just fine
<cfdirectory
action="list"
directory="C:\ColdFusion10\cfusion\wwwroot\test"
sort="directory ASC"
name="resultQry"
/>
So CF treats the two references differently it appears. I'm just trying to figure out how/why it does, and what work-around I can use to get it to function as desired.
I should also mention that IF I set myself (as the CF service account user) with my AD creds, the UNC path works just fine and can access the UNC(\uncPath\test). So I'm not sure why there's a discrepancy there between myself, and a service account user w/ the same access rights to a UNC location on the network.