I have a JiraWebActionSupport class with this code to get file upload:
HttpServletRequest wrapperReq = ServletActionContext.getRequest();
if (wrapperReq != null && wrapperReq instanceof MultiPartRequestWrapper) {
MultiPartRequestWrapper mpr = (MultiPartRequestWrapper) wrapperReq;
LOGGER.debug("Filenames found: ");
Enumeration fileNames = mpr.getFileNames();
while (fileNames.hasMoreElements()) {
String s = String.valueOf(fileNames.nextElement());
LOGGER.debug(s + ": " + mpr.getFile(s) + "; " + mpr.getFilesystemName(s));
}
}
It was working yesterday.
But today my plugin SDK’s 3-day license is about to expire. So I restarted the server, and SDK downlaoded some updates. Now the file upload fails, .getFile() will return null.
I got these debug output:
2023-03-29 10:51:01,706 http-nio-2990-exec-3 DEBUG admin 651x11467x1 tmit1t 0:0:0:0:0:0:0:1 /secure/admin/plugins/handler/ExportAction2.jspa [c.igsl.configmigration.ExportAction2] doExecute
2023-03-29 10:51:01,706 http-nio-2990-exec-3 DEBUG admin 651x11467x1 tmit1t 0:0:0:0:0:0:0:1 /secure/admin/plugins/handler/ExportAction2.jspa [c.igsl.configmigration.ExportAction2] Filenames found:
2023-03-29 10:51:01,706 http-nio-2990-exec-3 DEBUG admin 651x11467x1 tmit1t 0:0:0:0:0:0:0:1 /secure/admin/plugins/handler/ExportAction2.jspa [c.igsl.configmigration.ExportAction2] importFile: null; Server All Objects.json
MultipartRequest gave me the expected filename, but cannot get the file object.