Often Misused: File Upload in Java and JSP file
05:17 09 Dec 2019

I am getting the "Often Misused: File Upload" on the below lines. Can anyone suggest the fix.

  1. JAVA file:

    **public void setAttachedFile(FormFile formFile) { // File upload error at this line**
           attachedFile = formFile;
    
           if (attachedFile != null) {
                formData.put("attachedFile", attachedFile);
           } else {
                  formData.remove("attachedFile");
            }
    
          }
    
  2. JSP file:

      Select File Name ** // Getting the fortify here**

Can anyone please suggest the fix/solution

java jsp file-upload fortify