2012-01-03 43 views
0

這是我到目前爲止的代碼。如何讓ColdFusion 9多文件上傳工作?

<script language="JavaScript" type="text/javascript"> 
function onCancel() 
{ 
    ColdFusion.FileUpload.cancelUpload('myupload'); 
}; 

<cfform name="form01" action="#event.buildLink('login.fileAttachment')#"> 
<cfinput type="button" name="cancelupld" value="Cancel Upload" onclick="onCancel()"> 

</cfform> 

<!--- 
<cffile action="uploadall" destination="D:\apache\htdocs\awng\upload" nameconflict="overwrite" /> 
<cfinput type="submit" name="submit" value="Upload"> 
---> 

哪些文件,我需要做這項工作?

+1

http://www.raymondcamden.com/index.cfm/2009/11/14/some-notes-on-cffileuploadall – Henry 2012-01-03 23:21:20

回答

0

<cffile action="uploadall"...>由處理表單提交的代碼執行;在你的情況下,由此產生的動作:#event.buildLink('login.fileAttachment')#。因此,您首先需要在表單中包含文件上傳控件。 <cffileupload>可能是一個很好的選擇。然後,在login.fileAttachment代碼中,您將執行<cffile action="uploadall">標記,處理在表單上選擇的選定文件。

進一步閱讀:

cffileupload

cffile action="uploadall"