Hello...

I've posted messages in reference to using the FileUpload and it seems
that I am still having problems. I am now trying to put the class
together line by line so that if I run into problems I can successfully
identify the line and try to fix the problem/exception error. Here is
the code I have so far and it gives me the following error:

javax.servlet.ServletException: Servlet execution threw an exception

With the root cause information of:

java.lang.NoSuchMethodError:
org.apache.commons.fileupload.DefaultFileItem: method
(Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;ILjava/io/File;)
V not found
        at
org.apache.commons.fileupload.DefaultFileItemFactory.createItem(DefaultF
ileItemFactory.java:231)
        at
org.apache.commons.fileupload.FileUploadBase.createItem(Compiled Code)
        at
org.apache.commons.fileupload.FileUploadBase.parseRequest(Compiled Code)
        at FileTransfer.doPost(FileTransfer.java:37)


The code:

import java.io.*;
import java.util.*;
import javax.servlet.*;
import java.sql.*;
import javax.servlet.http.*;

import org.apache.commons.fileupload.*;

public class FileTransfer extends HttpServlet
{
        private String strSQLStart = "Insert into tblPortal Files (";
        private String strSQLMid   = " rec_id, dateupload) values (";
        private String strSQLEnd   = " Null, curdate())";
        
        private String fieldnames =  "";
        private String fieldvalues = "";
        
        public void doPost(HttpServletRequest req, HttpServletResponse
res)
        throws ServletException, IOException
        {
        res.setContentType("text/html");
        PrintWriter out = res.getWriter();
                
        DiskFileUpload upload = new DiskFileUpload();
                
        //set paramaters for files
        upload.setSizeMax(10000);
        upload.setRepositoryPath("/tmp");

        out.println("<html>");
        out.println("<head><title>MARC Research File
Upload</title></head>");
        out.println("<body>");
        out.println("File Upload Parameters:");
                
        try
        {
        List uploadItems = upload.parseRequest(req);
<-------- This is line 37       
        }
                
        catch (FileUploadException fue)
        {
        fue.printStackTrace(out);
        }

        out.println("</body></html>");
        }
}


I am trying to figure my way through it and any help would be
appreciated.....


Thanks....Allen
This message may contain proprietary or confidential company information.
Any unauthorized use or disclosure is prohibited.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to