If you expect really large file uploads, then it would be nice to report to your users, how much is already received. Even HTML pages allow implementing a progress bar by returning a multipart/replace response, or something like that. Tracking the upload progress may be done by supplying a
ProgressListener is called quite frequently, depending on the servlet engine and other environment factors it may be called for any network packet. In other words, your
ProgressListener may become a performance problem! A typical solution might be to reduce the activity of
ProgressListener to only emit a message if the number of megabytes has changed beyond a range. The following example shows a
ProgressListener which ...