commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Fong" <lielars...@gmail.com>
Subject Re: Problem using Commons fileupload for progress bar with Javaworld example
Date Mon, 25 Aug 2008 06:54:04 GMT
Hi Garrett

I'm pretty sure it uploaded the file. I know that Javaworld Example uses
iFrames. I pass javascript calls to the iFrame. The file is uploaded into
the specified the directory. The form is submitted using normal form
submission not XHR. XHR is used to track the progress of the file uploading.

My only problem is as mentioned, parseRequest method which I can't control
like a thread, because when I move the parseRequest into the run method, it
throws a NullPointerException. For some reason, HttpServletRequest object
that is the parameter of parseRequest cannot be contained in a thread.

The JVM executes parseRequest completely then subsequent lines. The servlet
won't execute parseRequest independently, so that we can track the progress.


Cheers
Patrick

2008/8/25 Garrett Smith <dhtmlkitchen@gmail.com>

> On Sun, Aug 24, 2008 at 9:31 PM, Patrick Fong <lielarster@gmail.com>
> wrote:
> > Hi
> >
> > I'm using Apache Commons for FileUpload to do a progress bar using Ajax.
> I'm
> > using prototype for ajax.
>
> Do you mean Prototype.js?
>
> http://www.prototypejs.org/learn/introduction-to-ajax
> | Ajax functionality is contained in the global Ajax object.
> | The transport for Ajax requests is xmlHttpRequest,
>
> Did you notice that the JavaWorld example is using an iframe?
>
> With the exception of Firefox, and possibly Webkit in the near future,
> you can't send a file over XHR.
>
> > I found that when the code hits 'upload.parseRequest', the servlet
> completes
> > that line, that is uploads the file before proceeding. Hence I can't
> track
> > the file upload even using the ProgressListener implementation.
> >
>
> I think you must be mistaken. The file was not uploaded. Certainly the
> servlet did not upload the file; it merely performed the task of
> processing the request it got from the container.
>
> Garrett
>
> > Cheers
> > Patrick
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message