java - MultipartServletWebRequest.getFiles() returns empty map -
in wicket 1.5 processed uploaded files in way:
public uploadvaluepage(pageparameters parameters) { super(parameters); bytes maxsize = bytes.kilobytes(20000); servletwebrequest swr = (servletwebrequest) getrequest(); multipartservletwebrequest mswr = swr.newmultipartwebrequest(maxsize, "uploadid"); fileitem item = mswr.getfile("fileinput").get(0); // process item }
but after migrating wicket 6 there no files in map. why?
after searching on web found this:
http://wicketinaction.com/2012/11/uploading-files-to-wicket-iresource/
so need line since wicket 6.18.0:
public uploadvaluepage(pageparameters parameters) { super(parameters); bytes maxsize = bytes.kilobytes(20000); servletwebrequest swr = (servletwebrequest) getrequest(); multipartservletwebrequest mswr = swr.newmultipartwebrequest(maxsize, "uploadid"); mswr.parsefileparts(); // since wicket 6.18.0 fileitem item = mswr.getfile("fileinput").get(0); // process item }
Comments
Post a Comment