commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikhil S. Kamath" <>
Subject PortletFileUpload parse not working properly
Date Mon, 21 Nov 2005 11:50:49 GMT
I am trying to use the portlet file upload classes from  1.1 dev commons-fileupload jar.

In the code below, when upload(PortletFileUpload) parses the request ,no exception is throws
and the method just returns

i m saying this because on console i get  println("starting request parsing") before parsing
but not println("request parsed"); which is

just next line of the code.the most surprising part is that no exception is thrown and method
just returns.

Am i doing something wrong.I have checked that SizeThreshold,SizeMax have properly been set

Incoorect values gave me FileUploadException

I would be glad if someone helped me out



public void uploadAction(ActionRequest request, ActionResponse response) throws PortletException,




                                    DiskFileItemFactory diskFileItemFactory=new DiskFileItemFactory();

                                    diskFileItemFactory.setRepository(new File(TempDirectory));



                                    PortletFileUpload upload = new PortletFileUpload(diskFileItemFactory);




                                                System.out.println("starting request parsing");

                                                List items = upload.parseRequest(request);

                                                System.out.println("request parsed");


                                                Iterator iter = items.iterator();

                                                while (iter.hasNext())


                                                            System.out.println("iteator hasitems");

                                                            FileItem item = (FileItem);


                                                            if (!item.isFormField())







                                    catch(FileUploadException ioe)


                                                System.out.println("FileUploadException Exception");



                                    catch(Exception ioe)


                                                System.out.println("General Exception");






                        System.out.println("Not Multipart");









"Making a valuable difference"
Mastek in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCO

Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited,
unless specifically indicated to that effect. Mastek Limited does not accept any responsibility
or liability for it. This e-mail and attachments (if any) transmitted with it are confidential
and/or privileged and solely for the use of the intended person or entity to which it is addressed.
Any review, re-transmission, dissemination or other use of or taking of any action in reliance
upon this information by persons or entities other than the intended recipient is prohibited.
This e-mail and its attachments have been scanned for the presence of computer viruses. It
is the responsibility of the recipient to run the virus check on e-mails and attachments before
opening them. If you have received this e-mail in error, kindly delete this e-mail from all

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message