/ Published in: ColdFusion

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<cfset startDir = "C:\"> <cfset newDir = startDir & replace(Form.Listing, " ", "_", "All")> <cfdirectory directory="#newDir#" action="CREATE" > <cfset aResults = StructFindKey(#Form#, "FiletoUpload-0", "all")> <!---<cffile action="upload" destination="#newDir#" nameConflict="overwrite" fileField="Form.FiletoUpload-0">---> <body> <cfoutput> <cfloop collection = #Form# item = "forms"> <tr> </tr> </cfloop> </cfoutput> <cfdump var="#aResults#"> </body> </html> <cfif StructKeyExists(Form, "fieldnames")> <cfloop list=#form.fieldnames# index="i"> <cfif FindNoCase("FiletoUpload-",i) AND Len(form[i])> <cffile action="upload" destination="#newDir#" nameConflict="overwrite" fileField="#i#" result="ThisFile"> </cfif> </cfloop> </cfif>
Comments
