Hi Nick,

Indeed, Click parses the request using Commons FileUpload by default
so that the uploaded FileItem is available to the FileField control.
You could also access the FileItem through the Context.getFileItem(String name);

Any reason you don't want to use the FileField control?

You could replace Click's default FileUpload to do nothing by default
allowing you to manually parse the request.

Hope this helps.

Bob

On 2011/08/22 07:53 AM, Nicholas Dierauf wrote:
>
> Hello,
>
>
>
> I am trying to use Click to upload a file from a form. I was successful in 
> doing this when I created my own “vanilla” servlet to process the upload 
> using Apache Commons FileUpload package. But when I try to process the file 
> upload in a Page class I am finding that:
>
> List<FileItem> items =  service.parseRequest(request);
>
> returns a list of size zero.
>
>
>
> I observed that the first question/answer in the commons FileUpload FAQ 
> (http://commons.apache.org/fileupload/faq.html) is this:
>
> Q: Why is parseRequest() returning no items?
>
> A: This most commonly happens when the request has already been parsed, or 
> processed in some other way. Since the input stream has aleady been consumed 
> by that earlier process, it is no longer available for parsing by Commons 
> FileUpload.
>
>
>
> Does anybody know if the ClickServlet is consuming the multipart request 
> input stream before constructing the Page object? Note, I am also using 
> Apache Shiro for authc/autha and have configured a ShiroFilter which may also 
> be my culprit, but I’m not seeing any evidence during debug.
>
>
>
> Any help with this is appreciated.
>
> Nick.

Reply via email to