我在ColdFusion9中遇到cffileupload函数问题。我选择上传时,它会将第一个文件上传到正确的位置,但进度条显示为红色并显示错误。如果我再次点击上传,它与下一个文件完全相同。在浏览控制台中,它显示状态:500。我搜索了这个问题,但没有找到答案。有没有人能够让它正常工作?
submission.cfm:
<cfset session.myuploadroot = "\\coldfusion\devl\uploads\cfeis_redbook\">
<form action="submission.cfm" method="post">
<cffileupload extensionfilter="xls,xlsx,doc,docx,pdf" name="bfiles" maxfileselect="3" title="Portfolio Images" url="fileupload.cfm?#urlEncodedFormat(session.urltoken)#" oncomplete="handleComplete">
</form>
fileupload.cfm
<cfif structKeyExists(form, "filedata")>
<cffile action="upload" filefield="filedata" destination="#session.myuploadroot#" nameconflict="overwrite" result="result">
</cfif>
<cfset str.STATUS = 200>
<cfset str.MESSAGE = "passed">
<cfoutput>#serializeJSON(str)#</cfoutput>