Ticket #251 (closed defect: fixed)

Opened 12 years ago

Last modified 12 years ago

WinXP testing: upload works, but user does not get sent to endpage.php

Reported by: kmaclean Owned by: kmaclean
Priority: critical Milestone: SpeechSubmission 0.1
Component: SpeechSubmission Version: Website 0.2
Keywords: Cc:

Description (last modified by kmaclean) (diff)

WinXP testing: zip audio file gets uploaded to server, but user does not get sent automatically sent to endpage.php (which is what happens in FireFox? v1.5, FC6)

Change History

comment:1 Changed 12 years ago by kmaclean

WinXP on Firefox(r2.07)

upload bar shows complete, java log shows uploader script has accetped submission, but user does not get transferred to endpage.php ...? works on Firefox 1.5 Linux(FC6)

comment:2 Changed 12 years ago by kmaclean

IE 7 on WinXP

upload bar shows complete, but user does not get transferred to endpage.php, zip file successfully transmitted to server ... ?security issue?

comment:3 Changed 12 years ago by kmaclean

Things to try:

  1. try Firefox 2.0 on FC6 to see if the problem is related to FireFox?
  2. might be a problem with the ShowDocument? code in CapturePlayback?.java:
  if (endPageURL != null){
                System.err.println("Finished! Sending you on to "+endPageURL);
                ((JApplet)(getParent().getParent().getParent().getParent())).getAppletContext().showDocument(endPageURL);

comment:4 Changed 12 years ago by kmaclean

Workaround:

  1. Add a message to the upload bar saying that audio zip file correctly uploaded and
  2. provide a link to endpage.php so people can confirm their audio was uploaded

comment:5 Changed 12 years ago by kmaclean

  • Status changed from new to assigned

comment:6 Changed 12 years ago by kmaclean

  • Description modified (diff)

comment:7 Changed 12 years ago by kmaclean

From this post:

I am trying to display a local HTML file in a signed applet. The following code of my JApplet implemenation shows how I did it:

...
File file = new File ("c:/test.html");
URL fileLocation = file.toURL();
getAppletContext().showDocument(fileLocation, "_blank");
...

try using

import java.applet.*;
...
....
try{
AppletContext browser=getAppletContext();
browser.showDocument(new URL("file:<your filename."));
}catch(MalformedURLException e){}


  It seems that I could not load

up the file using IE. However, it works on Netscape 6. Does anyone have an idea?

comment:8 Changed 12 years ago by kmaclean

This post says:

> java.applet.AppletContext.showDocument(URL,String) seems to be blocked
  > by pop-up blockers in IE (XP-SP2, Google toolbar, MSN Toolbar), even
  > if the applet is signed. I haven't tested Mozilla, but I assume it's
  > the same.
  >  
  > no significant indication to the user ...

See Pop-up blockers blocking Java showDocument

The Netscape/Firefox? and Apple popup blockers use a different approach and do not block showDocument.

For Internet Explorer possible workarounds are:

  1. Convert all your documentation or referred content from HTML pages to other forms
  2. Offer advice on enabling popups for your site
  3. switch users away from Internet Explorer

comment:9 Changed 12 years ago by kmaclean

could this have something to do with fact jar is compiled in jvm 1.5, but the windows machine is using jvm 1.6??

comment:10 Changed 12 years ago by kmaclean

Seems like this has nothing to do with showDocument.

It seems more like its related to a different version of Java being used on the Windows Browsers (FF2 and IE7):Java v1.6 and the Linux PC: Java 1.5. I put this line of code in setProgress method in CapturePlayback?:

System.err.println("setProgress(): Not reached end yet. sentBytes="+sentBytes+", totalBytes="+totalBytes);

and for some reason the totalBytes and sentBytes never become equal, therefore the showDocument never gets executed.

Need to test this theory by running the applet on FC6, FireFox? 1.5, with jvm 1.6

Here is the setProgress method:

    // Methods called by the "postlet" UploadManager and UploadThread
    public synchronized void setProgress(int a) {
        sentBytes += a;
        progBar.setValue(sentBytes);
        if (sentBytes == totalBytes){
            //DEL progCompletion.setText(pLabels.getLabel(2));
            if (endPageURL != null){
                progBar.setString("Upload completed... Thank you for your submission!");
                progBar.setIndeterminate(false);
                System.err.println("Finished! Sending you on to "+endPageURL);
                ((JApplet)(getParent().getParent().getParent().getParent())).getAppletContext().showDocument(endPageURL);
            } else {
                // Just ignore this error, as it is most likely from the endpage
                // not being set.
                // Attempt at calling Javascript after upload is complete.
//FORDEBUG
                System.err.println("setProgress(): endPageURL is null, so trying to use the javascript hook to end.");
                JSObject win = (JSObject) JSObject.getWindow((JApplet)getParent());
                win.eval("postletFinished();");
            }
            // Reset the applet
            progBar.setValue(0);
          //  if(subject != null) { // Will be non-null if passed in as a param - even if blank
          //    subjectBox.setEnabled(true);
          //  }
        } else {
//FORDEBUG
           System.err.println("setProgress(): Not reached end yet. sentBytes="+sentBytes+", totalBytes="+totalBytes);
        }
     }

comment:11 Changed 12 years ago by kmaclean

tried applet with fc6-ff1.5-jvm 1.6 and it works fine (user gets sent to endpage.php), although there still seems to be a problem with senBytes and totalBytes not matching:

setProgress(): Not reached end yet. sentBytes=218112, totalBytes=49152
setProgress(): Not reached end yet. sentBytes=219136, totalBytes=49152
setProgress(): Not reached end yet. sentBytes=220160, totalBytes=49152
HTTP/1.1 100 Continue


setProgress(): Not reached end yet. sentBytes=221162, totalBytes=49152

comment:12 Changed 12 years ago by kmaclean

see ticket #254 - sentBytes and totalBytes not matching when uploading a zip file

comment:13 Changed 12 years ago by kmaclean

  • Status changed from assigned to closed
  • Resolution set to fixed

This problem was in fact related to ticket 254 ... once I fixed sentBytes and totalBytes not matching when uploading a zip file, then after an upload, the user now gets sent to the endpage.php on Windows XP IE7 and FireFox? 2.0.

Solution - just set totalBytes to be equal to the entire zip file:

totalBytes = ((int)archiveFile.length()) ; 
//############ Upload #################################### 

// Upload manager needs an array but JavaUpload.php script can only handle one file at a time
File[] archiveFiles = new File[1];

archiveFiles[0] = archiveFile;
                        UploadManager u;

comment:14 Changed 12 years ago by root

  • Milestone SpeechSubmission 0.1 deleted

Milestone SpeechSubmission 0.1 deleted

comment:15 Changed 12 years ago by kmaclean

  • Milestone set to SpeechSubmission 0.1
Note: See TracTickets for help on using tickets.