September 27, 2022
cfimage unable to write to tmp directory when sandbox is enabled
Comments
(1)
September 27, 2022
cfimage unable to write to tmp directory when sandbox is enabled
(1)

Issue 

If the Sandbox Security option is enabled and you’re attempting to write to the temp directory using cfimage, then the following exception appears. 

Application fails with 500 error because it is unable to access the temp directory. 

Solution 

Follow the steps below: 

  1. Add the path of the temp directory in jvm.config as shown below: 

-Djava.io.tmpdir=<path to temp directory> 

 

        2. Restart ColdFusion. 

1 Comment
2022-09-28 20:40:35
2022-09-28 20:40:35

Thanks for the post, Ravi. But are you saying this WILL happen, to anyone? Your first sentence is suggesting that, though I’m not sure it’s true. Can you please clarify? Or perhaps revise that first sentence to clarify?

Perhaps you mean this will happen only IF someone defines such a JVM arg and points to some temp folder other than CF’s default. Is that right?

If you do mean it could happen to anyone, then what if someone finds they HAVE NO -Djava.io.tmpdir defined in their CF JVM args? There’s not one there by default.

Might it be better to suggest that someone should look at the result of the gettempdirectory() function in CFML, which returns WHATEVER is the temp directory, however it may be set (by the OS, if not overridden by that JVM arg)? Then folks would add THAT to the sandbox list of allowed folders? Sincere question, not a snark.

Like
Add Comment