There is a slight problem with this approach.
Nothing in the HTTP spec says that form fields need to be submitted in the order in which they appear in the HTML source. So there is no guarantee as you are parsing the fields, that your 'source dir' would even come before your file upload.
The solution would be to upload the files to a constant temp directory, parse the request, and use the supplied value for 'directory' and
Java File I/O methods to move the file after upload.
This is even covered in the cos FAQ as the preferred method of doing file uploads to dynamic directories
(
http://www.servlets.com/cos/faq.html ) search that page for the
word 'safest'
[This message has been edited by Mike Curwen (edited December 10, 2001).]