Confluecne 8 compatibility issue (upload attachment)

I can not get files from request in Confluence 8.
Is this related to Confluecne 8 being upgraded to struts2?
I don’t know how to solve it in the code below.


<servlet-filter name="FileUpload Servlet Filter" i18n-name-key="" key="xxxxx"
                class="" location="before-dispatch"

java code:

public class FileUploadFilter implements Filter {
 public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
  if (requestURI.endsWith("/pages/plugins/attachments/doattachfile.action")) {    // attachment macro select a file then upload 
      HttpServletRequest request = (HttpServletRequest) servletRequest;
      AttachmentRequestWrapper attachmentRequestWrapper = new AttachmentRequestWrapper(request);

      DiskFileItemFactory factory = new DiskFileItemFactory();
      ServletFileUpload upload = new ServletFileUpload(factory);
      // get files from request
      List<FileItem> fileItems = upload.parseRequest(request);  // Confluence 8: fileTtems.size = 0    Confluence 7 works fine: fileTtems.size != 0
1 Like