Rank: Member
Groups: Member
Joined: 9/15/2005(UTC) Posts: 21
|
Hi, I am using the trial version of Image Uploader for testing. I am using code as below with relevant parts showing. My situation is that after upload I need to show the result of the action page that processes the uploaded batch of files. That is why you see the function ImageUploader_Progress also being used below. In IE this works fine. In Firefox 1.0.6, this crashes immediately after the page shows the server response. So everything looks fine for about a second, before Windows shows a program error and then throws Firefox out. I haven't yet tested on the Mac OS. Any suggestions? Code:<script language="javascript">
function ImageUploader_Progress(Status, Progress, ValueMax, Value, StatusText){
if (Status=="COMPLETE"){
document.clear();
document.write(StatusText);
document.close();
}
}
</script>
<script language="javascript">
var iu = new ImageUploaderWriter("ImageUploader", 600, 400);
iu.activeXControlEnabled = false;
iu.javaAppletEnabled = true;
//For Java applet we specify only directory with JAR files
iu.javaAppletCodeBase = "./";
iu.javaAppletCached = true;
iu.javaAppletVersion = "1.1.02.0";
iu.addParam("Layout","TwoPanes");
iu.addParam("FolderView", "List");
iu.addParam("FileMask", "*.*");
iu.addParam("MaxImageWidth","0");
iu.addParam("MaxImageHeight","0");
iu.addParam("MinImageWidth","0");
iu.addParam("MinImageHeight","0");
iu.addParam("ButtonSendText", "Upload");
iu.addParam("CheckFilesBySelectAllButton", "true");
iu.addParam("DeniedFileMask", "*.db;*.exe;*.asp;*.cfm;*.htm;*.log");
iu.addParam("TreePaneWidth", "200");
iu.addParam("BackgroundColor", "#5456");
iu.addParam("ShowDebugWindow","True");
iu.addParam("EnableRotate","False");
iu.addParam("Action","upload.cfm");
iu.addEventListener("Progress", "ImageUploader_Progress");
iu.writeHtml();
</script>
Edited by user Sunday, February 17, 2008 1:53:37 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Member
Groups: Member
Joined: 9/15/2005(UTC) Posts: 21
|
Update to the above: Safari and Firefox on the Mac have not problems with the operation.
|
|
|
|
Rank: Member
Groups: Member
Joined: 9/15/2005(UTC) Posts: 21
|
Never mind, I figured out what it was. I had another function in my code (that I had not listed) that added a field to the form before uploading. The eventListener for the method was added after the eventListener for checking for Progress. Hence wrong way: Code:iu.addEventListener("Progress", "ImageUploader_Progress");
iu.addEventListener("BeforeUpload", "ImageUploader_BeforeUpload");
Right way: Code:iu.addEventListener("BeforeUpload", "ImageUploader_BeforeUpload");
iu.addEventListener("Progress", "ImageUploader_Progress");
Apparently that confused Firefox on Windows and caused it to crash. Edited by user Sunday, February 17, 2008 1:53:21 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration, Moderator Joined: 7/28/2003(UTC) Posts: 1,660
Thanks: 5 times Was thanked: 76 time(s) in 74 post(s)
|
Quote:sunbomb (9/16/2005)Never mind, I figured out what it was. I had another function in my code (that I had not listed) that added a field to the form before uploading. The eventListener for the method was added after the eventListener for checking for Progress. Hence wrong way: Code:iu.addEventListener("Progress", "ImageUploader_Progress");
iu.addEventListener("BeforeUpload", "ImageUploader_BeforeUpload");
Right way: Code:iu.addEventListener("BeforeUpload", "ImageUploader_BeforeUpload");
iu.addEventListener("Progress", "ImageUploader_Progress");
Apparently that confused Firefox on Windows and caused it to crash. Yes, it is very weird Firefox bug. I have no idea why it happens, but we will monitor this bug in further releases Edited by user Sunday, February 17, 2008 1:53:07 PM(UTC)
| Reason: Not specified |
Best regards, Fedor Skvortsov
|
|
|
|
Rank: Member
Groups: Member
Joined: 9/15/2005(UTC) Posts: 21
|
Well, Firefox on Windows definitely crashes consistently when there is a particular usage of the Java ImageUploader. I hae also noticed that about once in 30-40 times, IE on Windows also crashes. Please try this code. Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Testing Aurigma ImageUploader</title>
<script language="javascript" src="iuembed.js"></script>
</head>
<body>
<script language="javascript">
function ImageUploader_Progress(Status, Progress, ValueMax, Value, StatusText){
if (Status=="COMPLETE"){
document.clear();
document.write("Done");
document.close();
}
}
function ImageUploader_BeforeUpload(){
var uploader = getImageUploader("ImageUploader");
//Do whatever code you want here
}
</script>
<script language="javascript">
var iu = new ImageUploaderWriter("ImageUploader", 600, 400);
iu.activeXControlEnabled = false;
iu.javaAppletEnabled = true;
//For Java applet we specify only directory with JAR files
iu.javaAppletCodeBase = "./";
iu.javaAppletCached = true;
iu.javaAppletVersion = "1.1.02.0";
iu.addParam("Layout","TwoPanes");
iu.addParam("FolderView", "List");
iu.addParam("FileMask", "*.*");
iu.addParam("MaxImageWidth","0");
iu.addParam("MaxImageHeight","0");
iu.addParam("MinImageWidth","0");
iu.addParam("MinImageHeight","0");
iu.addParam("ButtonSendText", "Upload");
iu.addParam("CheckFilesBySelectAllButton", "true");
iu.addParam("DeniedFileMask", "*.db;*.exe;*.asp;*.cfm;*.htm;*.log");
iu.addParam("TreePaneWidth", "200");
iu.addParam("BackgroundColor", "#5456");
iu.addParam("ShowDebugWindow","True");
iu.addParam("EnableRotate","False");
iu.addParam("Action","upload.cfm")
iu.addEventListener("BeforeUpload", "ImageUploader_BeforeUpload");
iu.addEventListener("Progress", "ImageUploader_Progress");
iu.writeHtml();
</script>
</body>
</html>
Your action page canbe anything, even an empty page. When the upload is complete, the Javascript should just clear the current document and write the word "Done" in the document. This happens, but after about a second or two, Firefox crashes. I have already been in touch with Alex Makhov of Aurigma about this. I am unsure whether this is a Firefox problem or a ImageUploader problem. Edited by user Sunday, February 17, 2008 1:51:54 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 8/3/2003(UTC) Posts: 998
|
Hello,
We have tried to reproduce the bug and the issue has really occurred. We are using LiveConnect to fire events so the reason of the problem is in LiveConnect. It doesn't allow to change current document while processing called JavaScript code. Try to write to another document of redirect to another page instead of writing to current document directly. |
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.