Jira Plugin with File Uploading

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");
    }

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
Community showcase
Published yesterday in Opsgenie

Getting the Most out of Atlassian and Opsgenie Together

We’re excited to invite you to this action-packed webinar where we will demonstrate how to integrate Opsgenie’s powerful alerting and on-call management tools with your entire Atlassian stack. Mar...

21 views 0 0
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you