Creating directories problem
<p>Can't figure out why this keeps creating 2 folders? It makes a '0' folder and whatever the jobID is from the html. I want uploaded files in the jobID folder, not the '0' folder.</p>

<pre><code>        int userID = 1; // test
        String coverLetter = "";
        String status = "Review";
        int jobID = 0;
        String directoryName = "";

        boolean isMultipart = ServletFileUpload.isMultipartContent(request);
        if(isMultipart &amp;&amp; request.getContentType() != null)
        {
            // Create a factory for disk-based file items
            FileItemFactory factory = new DiskFileItemFactory();

            // Create a new file upload handler
            ServletFileUpload upload = new ServletFileUpload(factory);

            // Parse the request
            List /* FileItem */ items = null;
            try
            {
                items = upload.parseRequest(request);
            }
            catch(FileUploadException e) {}

            // Process the uploaded items
            Iterator iter = items.iterator();

            while(iter.hasNext())
            {
                FileItem item = (FileItem)iter.next();

                if(item.isFormField())
                {
                    if(item.getFieldName().equals("coverLetter"))
                        coverLetter = item.getString();
                    if(item.getFieldName().equals("jobID"))
                        jobID = Integer.parseInt(item.getString()); 
                }

                directoryName = request.getRealPath("/") + "/Uploads/CV/" + jobID + "/";    

                File theDir = new File(directoryName);
                if (!theDir.exists())
                    theDir.mkdir();

                if(item.getFieldName().equals("file"))
                {   
                    File uploadedFile = new File(directoryName + item.getName());
                    try
                    {
                        item.write(uploadedFile);
                    }
                    catch(Exception e) {}
                }
}
</code></pre>

<p>Edit:</p>

<p>Problem solved.I want uploaded files</p>

<p>It was because it was in the jobID folder, not the '0' folder.</p>
