---how do I upload a FOLDER to the server? --

PLEASE oh god please. help. me. I've built a template driven web-site for
the local community college. Every instructor can upload templates for their
classes, which is a collection of files and graphics. The instructors want
to up load the root directory and all the folders inside of that (so
something like 1 folder with 4 html files and a number of folders in that.
One of those folders would be your classic 'images' folder.)

so here's the question:

---how do I upload a FOLDER to the server? --

you can only upload individual files using the cffile tag, and the cffftp
tag seems to have a similar limitation.

PLEASE, can any one point me in the right direction?

I've include one of the solutions I tried as a work around. It didn't work
because you can't set the Value attribute of a input=file tag the same way
you can with a input=text. (If you do set the value of the input=file tag,
the page you pass the variables to thinks they are empty regardless)

I m hoping this set of code will inspire someone.


FIRST FILE---------------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
        <title>Untitled</title>
</head>

<body>
<form action="uploadtest2.cfm" method="post" enctype="multipart/form-data">
  what is the local root folder? (the absolute path to this directory)
    <input name="LocalRoot" type="Text" width="50">
<br>
  list all the files you'd like to upload.
  Must be a comma delineated list
<br>
  <textarea cols="35" rows="10" name="localFile"></textarea>
<p>
what is the remote root folder? <input name="remoteRoot" type="Text"
width="50">

<input type="Submit">



</form>


</body>
</html>


SECOND FILE-----------------------------------------------
<cfset localfileLen = #listlen(form.localFile)#>
<cfset upLoadFile = #form.localRoot# & #form.localFile#>
<cfset UpLoadFile = arrayNew(1)>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
   <title>Untitled</title>
</head>

<body>


<cfloop index="z" from="1" to="#localfileLen#">
  <cfset upLoadFile[#z#] = (#form.localRoot#) &
(#listGetAt(form.localFile,z,",")#)>
   <form name="form1" action="uploadtest3.cfm" method="post"
enctype="multipart/form-data">
     <cfoutput><input type="text" name="upLoadFile#z#" value="
value="#upLoadFile[z]#""><p align="right"></p></cfoutput>
 </cfloop>
      <cfoutput>
            <input type="Hidden" name="localFile"  value="#form.localFile#">
            <input type="Hidden" name="remoteRoot" value="#form.remoteRoot#">
                <input type="Hidden" name="LocalRoot"  value="#form.LocalRoot#">
          </cfoutput>
          <input type="Submit">

        </form>

<cfoutput>
For testing variables
<br>
  form.localRoot #form.localRoot#
 <br>
  form.localFile #form.localFile#
</cfoutput>

</form>
</body>
</html>

THIRD FILE-----------------------------------------------------------

<cfset localfileLen = #listlen(form.localFile)#>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
        <title>Untitled</title>
</head>

<body>

<cfloop from="1" to="#localfileLen#" index="x">
  <cffile action="upload" destination="#form.remoteRoot#"
filefield="upLoadFile#x#">
</cfloop>

<cfoutput>
   for testing:
   <br>
    form.localFile = #form.localFile#
   <br>
    form.remoteRoot = #form.remoteRoot#
</cfoutput>

</body>
</html>

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

again these files are just for insperation. I was trying to work around the
"only upload one file at a time limitation" the idea was to have the
instructors point to a folder and list the files in that folder then have
cold fusion loop through it, doing all the leg work....

but the easiest solution would be to UPLOAD an ENTIRE FILE!!!

please... Its so late and Im so tired.....


Thank you
Jay


FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to