Hi,
 
In Case of <input type = "file"  name=""> ,
The TurbineUploadService makes unnecessary FileItem  for null attachment file name.
 
TurbineUploadService.java
Line 221 - 241
 
    /**
     * <p> Retrieves file name from 'Content-disposition' header.
     *
     * @return A String with the file name for the current
     * <code>encapsulation</code>.
     */
    protected String getFileName()
    {
        String cd = getHeader("Content-disposition");
        if(!cd.startsWith("form-data") && !cd.startsWith("attachment"))
            return null;
        int start = cd.indexOf("filename=\"");
        int end = cd.indexOf('"', start+10);
        if(start == -1 || end == -1)
            return null;
 +       String str = cd.substring(start+10,end).trim();
 +       if( str.length() == 0)
 +           return null;
 +       else
 +            return str;
  -        return cd.substring(start+10,end);
    }
Thanks,
 
youngho

Reply via email to