通过浏览器访问coldfusion临时文件

Pat*_*urg -1 coldfusion temp

如果我使用coldfusion的getTempDirectory()作为生成文件的路径,浏览器有没有办法访问它?或者,如果没有,我可以将临时路径配置为某个文件夹吗?

小智 8

您可以使用cfcontent标记提供内容.它读取文件并将内容发送到浏览器.

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

  • 我的投票把你的声誉超过了100美元.你欠我一杯啤酒. (2认同)