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.
-------------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.houseoffusion.com/banners/view.cfm?bannerid=48
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:198235
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