0
  if(ServletFileUpload.isMultipartContent(request))  // ako je forma multipart ulazimo u naredbu
           {
               FileItemFactory factory=new DiskFileItemFactory();
               ServletFileUpload upload=new ServletFileUpload(factory);

               List items=upload.parseRequest(request);
               Iterator iterator=items.iterator();

               while(iterator.hasNext()) {
                   FileItem item = (FileItem) iterator.next();
                   if (!item.isFormField())
                   {
                       out.print("Velicina fajla je: "+item.getSize());
                   }
               }
           }

enter image description here I try to upload file on the server over html form,where server(jsp page) parse them and read size of file and back answer to client the size of the file.But error in app shows when selected file on disk and clicked submit button.

ground
  • 76
  • 1
  • 10

1 Answers1

1

To me, it looks like you have some JAR files missing from your classpath. Probably commons-fileupload-.jar at a minimum.

Catchwa
  • 5,845
  • 4
  • 31
  • 57