Select a folder for batch upload
Hi,
Is it possible to select a folder using CF?
I'm trying to implement a batch upload and processing module and I'd like the user to select a folder containing all the files that need to be uploaded, instead of either selecting each file one by one, or doing multiple upload.
Even if it's multiple upload, the user still has to choose each file manually.
The idea is to automate this process to the maximum to reduce human intervention to the strict minimum.
After the user has selected his/her folder and clicked on the Submit button, the program needs to copy all the files from the user's source folder to a destination folder on the server and then make use of cfdirectory to list all the files and process each one. This is not a problem. I have tested the following with a hard-coded directory and it works great!
<!--- List files in the selected directory --->
<cfdirectory directory="#variables.selectedDirectory#" action="list" name="qDir">
<!--- Loop directory --->
<cfoutput query="variables.qList">
<!--- Invoke method to process each file in the directory --->
<cfinvoke method="processFileUpload" returnvariable="qDone">
<cfinvokeargument name="selectedFile" value="#variables.qDir.name#">
</cfinvoke>
</cfoutput>
The above is working already.
Now, to be able to automate the file copy process from the user's source folder to the destination folder on the server, I need to provide the user with a form where he/she can point to his/her source folder.
How can we do this in CF?
Thanks in advance.
Regards,
Yogesh.
