CFIMAGE "Unable to create temporary file" error

ColdFusion Add comments

Ever get the above error when trying to use CFIMAGE to resize images?

The cause is related to running security sandboxes and not running CF under the SYSTEM account.

If you are running a standard out of the box installation of ColdFusion which is running under the SYSTEM account by default, then CFIMAGE will use c:\windows\temp for creating its temp files, and that is the path you would need to put in your sandboxes.
But if you are running ColdFusion under a dedicated user account (as you should be) then CF will instead use that users temp folder.

e.g.

If your ColdFusion service runs under a user called "coldfusion", then the temp path will be

c:\users\coldfusion\AppData\Local\Temp

So if you use security sandboxes then you need to add the following paths to your security sandbox.

c:\users\coldfusion\AppData\Local\Temp\
c:\users\coldfusion\AppData\Local\Temp\-

If you are not sure what temp path is being used, run the following bit of code on a CFM page to find out.
 

<cfscript> 
writeoutput("Temp Dir : " & createobject("java","java.lang.System").getProperty("java.io.tmpdir") ); 
</cfscript>

 

Obviously we use security sandboxes on our servers and we also lock down ColdFusion, if you do not do either of those things then you probably will never have this issue, bit then you will probably have a hacked server anyway, so this would be the least of your worries Smile

0 responses to “CFIMAGE "Unable to create temporary file" error”

Leave a Reply

Leave this field empty

Powered by Mango Blog. Design and Icons by N.Design Studio