I'm trying to create a plugin which needs to read some data from a user-supplied file. I've tried a normal file-input HTML element in a form in a velocity template and posting to an action Java class (I think that makes sense?) but it seems that no files are passed.
I'm using the Apache ServletFileUpload class along with some others which are supposed to work for exactly what I need. I seem to be doing everything as per the tutorials I've seen around but it's not working. It does however work when I remove the enc-type but just for non-file inputs such as text, passwords etc.
So I've come to the conclusion that Jira is causing these issues. Anyone done something like this before or know if it's possible? Thanks The "receiving" code:
DiskFileItemFactory fileItemFactory = new DiskFileItemFactory(); ServletFileUpload upload = new ServletFileUpload(fileItemFactory); FileItemIterator iterator = upload.getItemIterator(request); List items = upload.parseRequest(request); Iterator it = items.iterator(); while (it.hasNext()) { FileItem item = (FileItem) it.next(); System.out.println("Got file"); }
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.