UploadProgressBar does not work in Safari browser?

View: New views
6 Messages — Rating Filter:   Alert me  

UploadProgressBar does not work in Safari browser?

by techisbest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The UploadProgressBar does not seem to update in Safari Ver. 3.1.1 (525.17).

The bar shows up, but it never updates.

It is working in IE and Firefox.

Has anyone else experienced this?

Re: UploadProgressBar does not work in Safari browser?

by Mathias Nilsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry for bringing up and old thread but I got the exact same problem. Anyone got this working on safari, chrome and opera?
I know that the UploadProgressBar uses it's own ajax request. Is it something in the source code?

IE6 PC - Works
IE7 PC - Works
Firefox ( 3.5 ) PC - Works
Google Crome ( 2.0.172.33  PC- Not working. Progressbar not updated
Opera (9.64 ) PC - Browser hangs

Firefox MAC - Works
Safari (3.2.1) Mac - Not working. Progressbar not updated
 
HTML in UploadProgressBar should be changed. The last div should have
display: none; clear: left; otherwise it is not correctly displayed on all browsers.

For now I have extended the UploadProgressBar and changed the html.

Re: UploadProgressBar does not work in Safari browser?

by igor.vaynberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

patches are welcome

-igor

On Fri, Jul 3, 2009 at 6:12 AM, Mathias
Nilsson<wicket.programmer@...> wrote:

>
> Sorry for bringing up and old thread but I got the exact same problem. Anyone
> got this working on safari, chrome and opera?
> I know that the UploadProgressBar uses it's own ajax request. Is it
> something in the source code?
>
> IE6 PC - Works
> IE7 PC - Works
> Firefox ( 3.5 ) PC - Works
> Google Crome ( 2.0.172.33  PC- Not working. Progressbar not updated
> Opera (9.64 ) PC - Browser hangs
>
> Firefox MAC - Works
> Safari (3.2.1) Mac - Not working. Progressbar not updated
>
> HTML in UploadProgressBar should be changed. The last div should have
> display: none; clear: left; otherwise it is not correctly displayed on all
> browsers.
>
> For now I have extended the UploadProgressBar and changed the html.
>
> --
> View this message in context: http://www.nabble.com/UploadProgressBar-does-not-work-in-Safari-browser--tp21571997p24322943.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>

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


Re: UploadProgressBar does not work in Safari browser?

by Mathias Nilsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I don't get it.. I have made a call to the javascript function here from progressbar but the UploadWebRequest always returns |0|0|0|0 for
Opera, chrome . This simple javascript should be sufficient. In safari the updateProgressBar() is not called at all.

var request = null;

function createTransport( url  ){
       
        try {
          request = new XMLHttpRequest();
        } catch (trymicrosoft) {
          try {
            request = new ActiveXObject("Msxml2.XMLHTTP");
          } catch (othermicrosoft) {
            try {
              request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (failed) {
              request = null;
            }
          }
        }

               

                request.open("GET", url+'?anticache='+Math.random(), true);
                request.onreadystatechange = updateProgressBar;
                request.send( null );
}

function updateProgressBar(){
        if( request != null ){
          if( request.readyState == 4 ){
                if( request.status == 200 ){
                       

                        var update = request.responseText.split('|');
                         

             var completed_upload_size = update[2];
             var total_upload_size = update[3];
             var progressPercent = update[1];
             var transferRate = update[4];
             var timeRemaining = update[5];
             
             alert( completed_upload_size + ":" + total_upload_size + ":" + progressPercent + ":" + transferRate + ":" + timeRemaining );
                       
             window.setTimeout( updateProgressBar(), 1000);
                }
          }
        }
}



Re: UploadProgressBar does not work in Safari browser?

by Mathias Nilsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, a obvious bug in the code. We need to call createTransport( url ) again in the setTimeout method.

Still, there is the chrome and safari bug.

Re: UploadProgressBar does not work in Safari browser?

by Mathias Nilsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

After dealing with this for a long time I desided to make my own servlet and AJAX communication and that works.
It seams to be a problem for Safari, Chrome to make a GET request to resources/classpath..... I don't see anything other than that that messes up the UploadProgressBar to work in all browsers.

Also, there is a bug in the percentage width for safari and Opera. You could do this by changing the % width to pixels and solve the problem.