Search code examples
coldfusiontemp

Accessing coldfusion temp files through browser


If I use coldfusion's getTempDirectory() as the path to generate a file, is there any way for a browser to access that? Or, if not, can I configure the temp path to be a certain folder?


Solution

  • You could serve the content using the cfcontent tag. It reads the file and sends the contents to the browser.

    <cfcontent  
        type = "text/html"  
        file = "#getTempDirectory()#\myfile.htm"  
        deleteFile = "No">