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

After updating the Confluence 8 version,
It’s going through the same phenomenon. Have you solved the problem? If you solved it, please share it.
Thank you.

Hi, XingGuo

I also work well on the 7th version of Confluence, but I’m experiencing the same issue on the 8th version.

List<FileItem> fileItems = upload.parseRequest(req);

fileItems is []

Did you solve this problem?