Your English is *much* better than my Japanese. ;-) Please refer to the FileUpload usage documentation, here:
http://jakarta.apache.org/commons/fileupload/using.html As you will see, you should be using the DiskFileUpload class, instead of the FileUpload class, if you want the default disk-based implementation. You should use the FileUpload class itself only if you need more control over the way in which FileItem instances are created. -- Martin Cooper On Fri, 21 Nov 2003, ume wrote: > How do you do. > > I am a Japanese. Name is Ume. > I am sorry that I am not good at English. > This mail post first time at English. > > I met the following exception using commons-FileUpload. > (I found same Problem , > http://www.mail-archive.com/[EMAIL PROTECTED]/msg03431.html) > > I found the solution method. > > Problem > --- > java.lang.NullPointerException > at > org.apache.commons.fileupload.FileUploadBase.createItem(FileUploadBase.java:507) > at > org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:390) > at HogeSrv.doPost(HogeSrv.java:65) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) > ... > > HogeSrv.java > 63: FileUpload fu = new FileUpload(); > 64: fu.setSizeMax(1000000); > 65: List fileItems = fu.parseRequest(req); > --- > > It was OK, when I add > fu.setFileItemFactory(new DefaultFileItemFactory()); > before 65 line. > > I see source > > FileUpload.java 1.24 > > /** > * Constructs an instance of this class which uses the default factory to > * create <code>FileItem</code> instances. > * > * @see #FileUpload(FileItemFactory) > */ > public FileUpload() > { > super(); > } > > and > > DiskFileUpload.java 1.4 > /** > * Constructs an instance of this class which uses the default factory to > * create <code>FileItem</code> instances. > * > * @see #DiskFileUpload(DefaultFileItemFactory fileItemFactory) > */ > public DiskFileUpload() > { > super(); > this.fileItemFactory = new DefaultFileItemFactory(); > } > > therefore > > FileUpload.java > > /** > * Constructs an instance of this class which uses the default factory to > * create <code>FileItem</code> instances. > * > * @see #FileUpload(FileItemFactory) > */ > public FileUpload() > { > super(); > // add line > this.fileItemFactory = new DefaultFileItemFactory(); > } > > It seems OK, this Source. > Is it solution method? > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]