Apache Commons File Upload in Struts Dispatch Action class (returnsfileItems 0)

S

sudpri02

Hi,

I am using the following form/Struts 1.1 Action class for File Upload
and I am getting the fileitems as 0. Using Apache Commons File Upload
to parse the request in the Dispatch Action.


JSP:
<form name="merlinUpdatePkgForm" action="/admin/Pkg.do?
method=fileupload" method="post" enctype="multipart/form-data">
<input type="file" name="postalTablePath">
<input type=submit value="Submit">
</form>



Struts action Action class:
---------------------------

public class MerlinUpdPkgCommon extends DispatchAction
{



public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws
Exception
{

DiskFileUpload fu = new DiskFileUpload();
List fileItems = = fu.parseRequest(request);
logger.info("fileItems"+fileItems.size());
Iterator itr = fileItems.iterator();

}


}


Any help is appreciated.


regards
sudha
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top