Hi ,
I am trying to get "webwork.multipart.MultiPartRequestWrapper" obect in my Jira plugin code.
Actually i want to read all the request information like Filenames,contentType and FILE from the Jira UI.
I am using the below code in my class to get all these details , but i am getting the object as null.
import webwork.action.ActionContext;
import webwork.multipart.MultiPartRequestWrapper;
import jxl.Workbook;
public abstract class CSVImporterAction extends JiraWebActionSupport {
MultiPartRequestWrapper multiWrapper = ActionContext.getMultiPartRequest();
Enumeration enumeration = null;
enumeration = multiWrapper.getFileNames();
while (enumeration.hasMoreElements()) {
.
.
}
}
Can any one please suggest the solution to get the "MultiPartRequestWrapper" object and read all the information from Jira UI (like filename, contentType and FILE content) or share any sample working example.
Thanks in Advance,
Satya.
Community moderators have prevented the ability to post new answers.
Try (needs commons-io), there is no meta data other than in the File class:
MultiPartRequestWrapper wrapper=(MultiPartRequestWrapper)ServletActionContext.getRequest(); File f=wrapper.getFile("yourFileInputName"); byte[]data=IOUtils.toByteArray(new FileInputStream(f))
@andy brook, @satya L
In my case i am still getting MultiPartRequestWrapper null as the request itself is plain/text seen in firebut.
Can you plz tell me how did you achive this.
Thanks in Adv. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.