Well this does not go very far to changing the standards, but this code will 
allow a user to upload as many files at they want, but they will have to select 
each one individually.

<cfif IsDefined("form.files")>
        Hello
        <cfdump var="#form#">
</cfif>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd";>
<html>
        <head>
                <meta http-equiv="Content-Type" content="text/html; 
charset=iso-8859-1">
                <title>Multiple File Upload</title>
                <script type="text/javascript" language="javascript">
                        var numberOfFiles = 1;
                        
                        function addFile()
                        {
                                var block = document.getElementById("inputs"); 
//Grab the file input container.
                                var newInput= document.createElement('input'); 
//Create a new input node
                                newInput.type = "file"; //Set the type of the 
node to "file"
                                newInput.name = "imageFile" + 
++numberOfFiles;//Set the name of the node
                                block.appendChild(newInput); //Append the new 
node to the input container
                        }
                </script>
                
                <style type="text/css" media="screen">
                        fieldset#inputs input
                        {
                                width: 50em;
                                display: block;
                        }
                </style>
        </head>
        
        <body>
                <form id="files" enctype="multipart/form-data" method="post">
                        <fieldset id="inputs"><input id="org" type="file" 
name="imageFile1"></fieldset>
                        <a href="javascript: addFile();">Another File</a><br/>
                        <input type="submit" name="files">
                </form>
        
        </body>
</html>


--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA
 
"C code. C code run. Run code run. Please!"
- Cynthia Dunning

....-----Original Message-----
....From: Rick Faircloth [mailto:[EMAIL PROTECTED]
....Sent: Thursday, March 10, 2005 9:17 AM
....To: CF-Talk
....Subject: RE: How to Browse and Choose Directory...
....
....> To enable uploading of whole directories the HTTP protocol, the
....> implementation of that protocol in the user's webbrowser, and possibly
....> the underlying operating system would have to be changed.
....
....Now that's the part that I'm saying will eventually need to be changed...
....
....Rick
....
....
....-----Original Message-----
....From: Tim Blair [mailto:[EMAIL PROTECTED]
....Sent: Thursday, March 10, 2005 11:53 AM
....To: CF-Talk
....Subject: RE: How to Browse and Choose Directory...
....
....
....Rick,
....
....> I understand that *currently* CFDirectory only has access to
....> my local system...what I'm talking about is developing a tag
....> that allows a user to specify a directory for upload the same
....> way we use CFFile now...
....
....There will never be a time when <cfdirectory> or <cffile> will have
....access to a user's file system.  This is not due to a lack of foresight
....on MM's part, but because of security restrictions put in place via the
....user's operating system and the HTTP protocol.
....
....To enable CF to have access to an arbitrary user's file system would
....also mean that it was open to anyone else who cared to have a look,
....hackers included.  You also have the issue of how to actually get to the
....user's machine: what would happen to users who are behind a proxy server
....or firewall?
....
....In case there is still confusion between client and server funcionality,
....I have detailed, step by step, the process of uploading a file via HTTP:
....
....1.  An HTML form is displayed to the user in their web browser
....    including a file upload field.
....2.  The user fills out the form and selects a file to upload
....3.  The user clicks the "submit" button
....4.  The web browser software (IE/Firefox/Opera etc) grabs the
....    required file from the user's file system
....5.  The file data is encoded in the header of the HTTP request
....    and sent to the web server
....
....All the above happens on the client side -- there is no interaction from
....the web server or ColdFusion.
....
....6.  The web server recieves the request
....7.  The uploaded file is decoded and placed in a temporary
....    location by the webserver software (IIS/Apache etc)
....8.  The uploaded file information is set in the environment
....    variables by the webserver
....
....We still haven't got to ColdFusion yet.  The above process is the same
....whether you are using Firefox on a PC and uploading to a webserver
....running IIS, or if you're using Lynx on a linux terminal uploading to
....Apache.
....
....At this point, the uploaded file is a temporary file sitting somewhere
....on the webserver (NOT on the client machine).
....
....9.  The webserver passes the request off to ColdFusion
....10. A <cffile action="upload"> call is made from within a CF
....    template
....11. CF moves the file from where it was put in point 7 above
....    (remember -- it's already on the server) to the CF temp
....    directory.  At the same time it reads information such as
....    the uploaded file name, MIME type and file size and places
....    the data in the CFFILE scope for you to play with.
....
....As you can see, ColdFusion has no access at all to the client machine.
....It purely acts on data on the server.
....
....To enable uploading of whole directories the HTTP protocol, the
....implementation of that protocol in the user's webbrowser, and possibly
....the underlying operating system would have to be changed.  I find it
....very very unlikely that this is ever going to happen, mainly for the
....security reasons that have already been mentioned, but also that it's a
....hell of a big job!  If in the unlikely event it *did* come about, it'd
....take a long time (years) for the protocol changes to be ratified and
....updated, and then longer still for the browsers to support the new
....method.
....
....As has been mentioned, one frequently used method of uploading multiple
....files is for the user to place all the required files in one zip file
....and upload that.  The process would then occur as above, but at the end
....you would run a <CFEXECUTE> command to unzip the file, and then process
....all the files uploaded individually.
....
....HTH,
....
....Tim.
....
....
....--
....-------------------------------------------------------
....Badpen Tech - CF and web-tech: http://tech.badpen.com/
....-------------------------------------------------------
....    RAWNET LTD - independent digital media agency
....    "We are big, we are funny and we are clever!"
....     New site launched at http://www.rawnet.com/
....-------------------------------------------------------
....This message may contain information which is legally
....privileged and/or confidential.  If you are not the
....intended recipient, you are hereby notified that any
....unauthorised disclosure, copying, distribution or use
....of this information is strictly prohibited. Such
....notification notwithstanding, any comments, opinions,
....information or conclusions expressed in this message
....are those of the originator, not of rawnet limited,
....unless otherwise explicitly and independently indicated
....by an authorised representative of rawnet limited.
....-------------------------------------------------------
....
....
....
....

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:198239
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to