commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gaston Escobar" <>
Date Thu, 20 Feb 2003 20:26:48 GMT

I don't really know where to post this e-mail. I'm sorry in case I've made a
I've tried to use the FileUpload package I downloaded. But in the example
code, it throws an error when I try to compile it.
This is the example code that comes with the package:

    public void doPost(HttpServletRequest req, HttpServletResponse res)
        FileUpload fu = new FileUpload();
        // maximum size before a FileUploadException will be thrown
        // maximum size that will be stored in memory
        // the location for saving data that is larger than

        List fileItems = fu.parseRequest(req);
        // assume we know there are two files. The first file is a small
        // text file, the second is unknown and is written to a file on
        // the server
        Iterator i = fileItems.iterator();
        String comment = ((FileItem);
        FileItem fi = (FileItem);
        // filename on the client
        String fileName = fi.getFileName();
        // save comment and filename to database
        // write the file
        fi.write("/www/uploads/" + fileName);

And this is the error my compiler throws: cannot resolve symbol
symbol  : method getFileName  ()
location: interface org.apache.commons.fileupload.FileItem
        String fileName = fi.getFileName();
1 error


Please, help me. And in case this e-mail was not correctly posted here, tell
me where I could do that
Thank you very much

View raw message