Fixes #25829 by changing the check away from instanceof. Now checking…… if the request has parts. If this is the case we extract them otherwise use getFile(). Test is added for verification.

Comment From: jhoeller

I eventually went with a different approach, preserving the StandardMultipartHttpServletRequest driven preference for Part resolution but also generally falling back to Part resolution at the end (after trying Spring's MultipartRequest API). The problem here is that HttpServletRequest.getParts() may trigger server-driven parsing of the multipart request even when Spring's multipart abstraction uses Commons FileUpload, so a straight initial attempt might interfere with our abstracted processing.

Thanks for the pull request, in any case!

Comment From: JWThewes

Thanks for explaining the chosen approach! Always nice to learn more about the backgrounds.