Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Apache Commons File Upload in Struts Dispatch Action class (returnsfileItems 0)

Reply
Thread Tools

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

 
 
sudpri02@gmail.com
Guest
Posts: n/a
 
      10-28-2008
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
 
Reply With Quote
 
 
 
 
donghongwu1985@gmail.com
Guest
Posts: n/a
 
      11-20-2008
On 10月29日, 上午2时04分, "(E-Mail Removed)" <(E-Mail Removed)> wrote:
> 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


Hi,I had the same problemn,I think you should try Action.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Commons File Upload in Struts .. Please respond ASAP pinik Java 0 10-28-2008 07:23 PM
Apache Commons File Upload in Struts .. Please respond ASAP pinik.smily4u@gmail.com Java 0 10-28-2008 07:11 PM
Apache Commons File Upload in Struts Dispatch Action class (returnsfileItems 0) sudpri02@gmail.com Java 0 10-28-2008 05:01 PM
Apache Commons File Upload Problem Chase Preuninger Java 0 06-14-2008 01:11 AM
Apache Commons File Upload Chase Preuninger Java 1 06-06-2008 11:55 PM



Advertisments