commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Norris" <thechrisproject.li...@gmail.com>
Subject Re: [fileupload] getting the simplest case to work
Date Thu, 15 May 2008 15:44:24 GMT
Ah... if a file input doesn't have a name, things break.  Good to know.

On Wed, May 14, 2008 at 3:34 PM, Chris Norris
<thechrisproject.lists@gmail.com> wrote:
> Hi, I'm having trouble getting started with the FileUpload project.  I
> have a service (hooked up via CXF) that does the following for a post
> request:
>
>                        boolean isMultipart = ServletFileUpload.isMultipartContent(request);
>                        if(isMultipart)
>                        {
>                                ServletFileUpload upload = new ServletFileUpload();
>                                FileItemIterator iterator = upload.getItemIterator(request);
>                                System.out.println(iterator.hasNext());
>                        }
>
> The request is multipart, but the item iterator is always empty.  I've
> tried submitting the request in three different ways: first from an
> Adobe Lightroom plugin (which is what I'm working on), then from a mac
> command-line curl call, then from a simple form, which I can reproduce
> here:
>
> <html>
> <head><title>testing</testing></head>
> <form
>        action="http://cjn-pc.widen.com:8080/services/backdrop/backdropservice/upload/"
>        method="POST"
>        enctype="multipart/form-data">
>        <input type="file"/>
>        <input type="submit" value="test"/>
> </form>
> </html>
>
> The item iterator always has zero items in it.  I've also tried
> executing this "simplest case" code:
> FileItemFactory factory = new DiskFileItemFactory();
> ServletFileUpload upload = new ServletFileUpload(factory);
> List /* FileItem */ items = upload.parseRequest(request);
>
> The items list is always empty.  I feel like I'm missing something
> obvious here.  Anyone have any ideas?
>
> Thanks,
> Chris
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message