title: Often Misused: File Upload in Java and JSP file
body: <p>I am getting the "Often Misused: File Upload" on the below lines.
  Can anyone suggest the fix.</p>
  
  <ol>
  <li><p>JAVA file:</p>
  
  <pre><code>**public void setAttachedFile(FormFile formFile) { // File upload error at this line**
         attachedFile = formFile;
  
         if (attachedFile != null) {
              formData.put("attachedFile", attachedFile);
         } else {
                formData.remove("attachedFile");
          }
  
        }
  </code></pre></li>
  <li><p>JSP file:</p>
  
  <pre><code>&lt;table width="100%" border="0" cellspacing="0" cellpadding="3"&gt;
              &lt;tr&gt;
                &lt;td class="label" width="1%"&gt;&amp;nbsp;&lt;/td&gt;
                &lt;td class="label" width="22%"&gt;Select File Name&lt;/td&gt;
                   &lt;td class="field" width="26%"&gt;
               **&lt;input class="textfield width450" type="file" name="File_Name" maxlength="255" value=""&gt; // Getting                  the fortify here**
                   &lt;/td&gt;               
                 &lt;/tr&gt;  
             &lt;/table&gt;
  </code></pre></li>
  </ol>
  
  <p>Can anyone please suggest the fix/solution</p>