【发布时间】:2013-02-17 06:04:49
【问题描述】:
我正在尝试删除并重新创建一个测试文件,但出现以下错误。谁能告诉我为什么会这样?
错误:
ColdFusion could not delete the file e:\sample\test2.html for an unknown reason.
代码:
<cfif FileExists("e:\sample\test2.html")>
<cffile action="delete"file="e:\sample\test2.html"><br>
<p>deleted the file </p>
<cfelse>
<p>Sorry, can't delete the file - it doesn't exist.</p>
</cfif>
<cfset createObject("java", "java.lang.Thread").sleep(JavaCast("int", 90000))>
<cfsavecontent variable="HTML">
<cfinclude template="noticeEmail.cfm">
</cfsavecontent>
<cffile action="WRITE" attributes = "normal" nameconflict="Overwrite"
file="e:\sample\test2.html" output="#HTML#">
【问题讨论】:
-
这与你的错误无关,但
nameconflict属性不适用于action="write",只能上传。