ColdFusion Cffile上传将参数传递到动作页面
在ColdFusion中,我有一个基本的CFFILE上传,当NameConflict参数明确时,例如“ oftrite”。但是,当我尝试传递参数时,它不起作用。
<cfoutput>
<cfset confl = 'overWrite'>
<form
enctype = "multipart/form-data"
method = "post"
name = "uploadForm"
action = "">
<input name = "theupload"
type = "file"
style = "font-family: comic sans ms; color: ##679C9C">
<input type = 'hidden' name = 'confl' value = '#confl#'>
<cfinclude template = 'submitbut.cfm'>
</form>
</cfoutput>
<cfif IsDefined("form.theupload")>
<cfoutput>
<cffile action = "upload"
destination = "#session.exploc#"
fileField = "form.theupload"
mode = '666'
result = 'ss'
nameConflict = "#form.confl#" >
</cfoutput>
</cfif>
这只是cffile上传的本质吗?有没有办法将参数传递到操作页面?以上代码在多个地方使用,我并不总是希望“覆盖”名称冲突。当唯一的区别在于名称冲突中,我不得不使用两个程序。
In coldfusion I have a basic cffile upload which works fine when the nameconflict parameter is explicit, such as 'overwrite'. But when I try to pass a parameter, it doesn't work.
<cfoutput>
<cfset confl = 'overWrite'>
<form
enctype = "multipart/form-data"
method = "post"
name = "uploadForm"
action = "">
<input name = "theupload"
type = "file"
style = "font-family: comic sans ms; color: ##679C9C">
<input type = 'hidden' name = 'confl' value = '#confl#'>
<cfinclude template = 'submitbut.cfm'>
</form>
</cfoutput>
<cfif IsDefined("form.theupload")>
<cfoutput>
<cffile action = "upload"
destination = "#session.exploc#"
fileField = "form.theupload"
mode = '666'
result = 'ss'
nameConflict = "#form.confl#" >
</cfoutput>
</cfif>
Is this just the nature of cffile upload? Is there a way to pass a parameter to the action page? The above code is used in several places, and I don't always want the name conflict to be 'overwrite'. I hate to have to use two programs when the only difference is in the name conflict.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
&lt; cffile&gt;
包装在CFC中的功能中。Application
范围)。在CFC内部,请勿参考
session
,form
,application
,request
或任何其他外部示波器变量。仅将数据作为参数传递给该函数。另外,请确保var
或local
范围范围所有功能特定变量。<cffile>
in a function inside a CFC.application
scope).Inside the CFC, do NOT reference
session
,form
,application
,request
or any other external scoped variables. Only pass data in as arguments to the function. Also, make sure tovar
orlocal
scope all function specific variables.