This is not "slick", because the user has to do a browse for every file he 
wants to upload; but it works without java. If you want, you can use 
javascript dynamically change the filelist, instead of reloading the input 
page. Use divs and something like this:

function writetext(lay,txt) {
        if (isIE4) {
        document.all[lay].innerHTML = txt;
        }
        if (isNS4) { 
        document[lay].document.write(txt);
        document[lay].document.close();
        }
        if (isDOM) { 
        over = document.getElementById([lay]);
        range = document.createRange();
        range.setStartBefore(over);
        domfrag = range.createContextualFragment(txt);
        while (over.hasChildNodes()) {
                over.removeChild(over.lastChild);
        }
        over.appendChild(domfrag);
        }
}

------------------------------------------

<cfparam name="files2upload" default="1">
..
<table...>
<form ... action="index.cfm"...>
<input type="hidden" name="action" value="[runthisform]">
<tr><td>select number of files</td>
      <td><select name="files2upload" onchange="[submit]">
             <option value="1">1</option>
             .....
             </select></td>
</form>
</tr>
</table>
..
<table ...>
<form ... action="index.cfm"...>
<input type="hidden" name="action" value="[uploadfiles]">
<CFLOOP INDEX="filecount" FROM="1" TO="#files2upload#">
<tr><td rowcount="#files2upload#">
    <td><input type="file" name="ufilename#filecount#">
</tr>
</CFLOOP>
<input type="hidden" name="filecount" 
value="#files2upload#">
</form>
</table>
..



The upload cfm:

<cfloop index="cfilelocal" from="1" 
to="#form.filecount#">
<cfif Evaluate("form.ufilename#cfilelocal#") is not "">
        <CFFILE ACTION="Upload"
                FILEFIELD="ufilename#cfilelocal#"
                DESTINATION="#varloaddirectory#"
                NAMECONFLICT="Overwrite">
        </cfif>
</cfloop>




On 21 Mar 02, at 13:00, James Taavon wrote:

Jumping in on this thread...

What if you did not know the number of mutiple files and wanted to make it
dynamic via select box, say 1-5? I know Javascript is the anser, but I have
never done anything like that. Do you know of anybody that has?



-----Original Message-----
From: Dave Hannum [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 11:27 AM
To: CF-Talk
Subject: Re: Multiple File Upload


Multiple File fields with different names and a CFFILE for each..

Dave


----- Original Message -----
From: "Owen Leonard" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, March 21, 2002 11:08 AM
Subject: Re: Multiple File Upload


> I need to have a multiple file upload.

I've only ever heard two answers to this:

1. Some kind of custom Active-X somethingorother.
2. Multiple file input fields, followed by looping over cffile.

I'd certainly be interested if anyone has any better solutions.

    -- Owen

----
Athens County Library Services
http://www.athenscounty.lib.oh.us





______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to