You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Mathias Nilsson <wi...@gmail.com> on 2009/06/23 15:57:43 UTC

UploadProgressBar in firefox and ie6

Hi!

I'm trying to use the UploadProgressBar and it works in ie7 but not in
firefox 2.0.0.2 or ie 6.0.2900.2180
In firefox the progressbar is not updated and in ie 6 I get the following
exception

java.lang.IllegalStateException: ServletRequest does not contain mulipart
content.

I have setup my appication class by overriding the newWebRequest
@Override
protected WebRequest newWebRequest(HttpServletRequest servletRequest){
    return new UploadWebRequest(servletRequest);
}

I can see that the newWebRequest is accessed when using firefox but as I
said before, no update on the progress bar.

public class Test extends WebPage{
 FileUploadField upload;
 public Test(){
  UploadForm uploadForm = new UploadForm( "uploadForm" ){
   @Override
         protected void onSubmit()
         {
             final FileUpload up = upload.getFileUpload();
             if (up != null){
                 System.out.println( up.getClientFileName() );
                 File newFile = new File( "d:/", up.getClientFileName());
                 try{
                     newFile.createNewFile();
                     up.writeTo(newFile);
                 }catch (Exception e){
                     throw new IllegalStateException("Unable to write
file");
                 }
             }
         }
  };
  uploadForm.add( new UploadProgressBar("progress", uploadForm));
  upload = new FileUploadField( "upload" );
  uploadForm.add( upload );
  add( uploadForm );

 }

 class UploadForm extends Form<Void>{
  public UploadForm( String id ){
   super( id );
   setOutputMarkupId(true);
   setMultiPart( true );
  }
 }
}

Re: UploadProgressBar in firefox and ie6

Posted by Mathias Nilsson <wi...@gmail.com>.
When looking at the sourcecode of UploadProgressBar and the js file the file
is all in english. Has someone localized this update method
or is there a better way to do this?


-- 
View this message in context: http://www.nabble.com/UploadProgressBar-in-firefox-and-ie6-tp24166616p24211272.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: UploadProgressBar in firefox and ie6

Posted by Mathias Nilsson <wi...@gmail.com>.
Since I can get this to work in all browsers I need some advice on how to
handles this myself.

I have created a Servlet ( apache commons upload ) that uploads the file in
doPost and check the percentage in doGet

How can I communicate with the servlet from wicket ajax. Any pointers would
be appreciated.
-- 
View this message in context: http://www.nabble.com/UploadProgressBar-in-firefox-and-ie6-tp24166616p24205091.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org