The following works in IE 5.5. It does not work in Netscape 4.7 because Netscape is not capturing the event "onChange". If your users use Netscape, you'll have to experiment to find out which events are being captured. Or try Netscape 6.2
Also, there are other ways to get the Javascript data to ColdFusion.
<cfparam name="operation" default="get files">
<cfif operation="get files">
<script language="javascript">
var fileList = '';
function appendToList(s) {
var delim = ','; //assumes that there are no commas in the filename or path
if (fileList.length == 0) {
delim = '';
}
fileList = fileList + delim + s;
}
function assign_filelist(f) {
f.filespeclist.value = fileList;
return true;
}
</script>
<form name="getfiles" onSubmit="return assign_filelist(this);" method="post">
<input type="file" name="filespec" onChange="appendToList(this.value);"><br>
<input type="hidden" name="filespeclist" value="">
<input type="hidden" name="operation" value="process"><br>
<input type="submit" value="Submit">
</form>
<cfelse>
<cfoutput><br>#filespeclist#</cfoutput>
</cfif>