Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Phive_  
#1 Posted : Thursday, January 18, 2007 7:07:29 AM(UTC)
Phive_

Rank: Member

Groups: Member
Joined: 1/17/2007(UTC)
Posts: 7

The below code works great with ActiveX (IE), but does not work with Java (FireFox)

I can't for the life of me figure out what I'm doing wrong.. please help!!

Code:
<!--- Image Uploader Script --->
<script type="text/javascript" src="../../Scripts/ImgUload/iuembed.js"></script>

<!--- JavaScript --->
<script type="text/javascript">
//<![CDATA[	
//Create JavaScript object that will embed Image Uploader to the page.
var iu = new ImageUploaderWriter("ImageUploader1", 650, 400);


//For ActiveX control full path to CAB file (including file name) should be specified.
iu.activeXControlCodeBase = "../../Scripts/ImgUload/ImageUploader4.cab";
iu.activeXControlVersion = "4,1,1,0";

//For Java applet only path to directory with JAR files should be specified (without file name).
iu.javaAppletCodeBase = "../../Scripts/ImgUload/";
iu.javaAppletCached = true;
iu.javaAppletVersion = "2.1.1.0";

iu.showNonemptyResponse = "off";

//Configure appearance and behaviour.
iu.addParam("PaneLayout", "TwoPanes");
iu.addParam("ShowDebugWindow", "true");
iu.addParam("ShowDescriptions", "false");
iu.addParam("BackgroundColor", "#ffffff");

//Configure Image Uploader to rotate photos automatically 
//according to the orientation stored in EXIF metadata.
iu.addParam("EnableAutoRotate", "true");

//Configure file mask to upload JPEG images only.
iu.addParam("FileMask", "*.jpeg;*.jpg;*.jpe");

//Set image size restrictions.
iu.addParam("MinImageWidth", "150");
iu.addParam("MinImageHeight", "150");

//Exclude the source file from upload because only 
//resized versions of the photo will be sent.
iu.addParam("UploadSourceFile", "false");

//Configure settings of the optimized image. Optimized image
//is resized to 1200x1200 with JPEG quality = 75 and EXIF 
//metadata is preserved.
iu.addParam("UploadThumbnail1FitMode", "Fit");
iu.addParam("UploadThumbnail1Width", "650");
iu.addParam("UploadThumbnail1Height", "650");
iu.addParam("UploadThumbnail1JpegQuality", "75");
iu.addParam("UploadThumbnail1CopyExif", "true");

//Configure thumbnail settings.
iu.addParam("UploadThumbnail2FitMode", "Fit");
iu.addParam("UploadThumbnail2Width", "120");
iu.addParam("UploadThumbnail2Height", "120");
iu.addParam("UploadThumbnail2JpegQuality", "75");

//Configure URL files are uploaded to.
iu.addParam("Action", "Tmplts/ImgUload/upload.cfm");
//Configure Rediret
iu.addParam("RedirectUrl", "?EditPic&JCreated&Site=<cfoutput>#URL.Site#</cfoutput>");

//Add event handlers.
iu.addEventListener("UploadFileCountChange", "ImageUploader_UploadFileCountChange");
iu.addEventListener("Progress", "ImageUploader_Progress");

//Tell Image Uploader writer object to generate all necessary HTML code to embed 
//Image Uploader to the page.
iu.writeHtml();
//]]>
</script>

1. Upload completes, and files are saved to the server

2. DB records are created

3. It will just not redirect after upload completes.

Java Console

Code:
ImageUploader version: 2.1.1
Current document URL: http://devhome/Members/Welcome/index.cfm?EditPic&Site=116
Reading cookies
Cookies: IWILLUID=Test%5FEmail%40devhome%2Ecom; CFID=3101; CFTOKEN=51051005; IWILLREMCKTST=CookiesOK
Reading referer
Referer: http://devhome/Members/Welcome/index.cfm?EditPic&Site=116
Reading additional form content
Uploading to http://devhome/Members/Welcome/Tmplts/ImgUload/upload.cfm
Setting HTTP params: Host=devhome
Starting upload
Status =[200]
Jan 18, 2007 5:57:42 PM org.apache.commons.httpclient.HttpMethodBase getResponseBody
WARNING: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
Upload complete. Result page:
<META NAME="ColdFusionMXEdition" CONTENT="ColdFusion DevNet Edition - Not for Production Use.">

{{LOTS OF BLANK SPACE}}

EndOf Result page

Edited by user Wednesday, February 20, 2008 4:12:27 PM(UTC)  | Reason: Not specified

Alex Makhov  
#2 Posted : Thursday, January 18, 2007 12:17:25 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups: Member
Joined: 8/3/2003(UTC)
Posts: 998

Hello,

Image Uploader for Java uses the following JavaScript code to implement the RedirectUrl functionality:

Code:
window.location.href = RedirectUrl;

Try to do it manually to check if this way of redirection works correctly.

May be you should try to use the absolute path.

Edited by user Wednesday, February 20, 2008 4:13:02 PM(UTC)  | Reason: Not specified

Sincerely yours,

Alex Makhov

UserPostedImage Follow Aurigma on Twitter!

Phive_  
#3 Posted : Friday, January 19, 2007 2:53:23 PM(UTC)
Phive_

Rank: Member

Groups: Member
Joined: 1/17/2007(UTC)
Posts: 7

Thanks for your reply!

I tried your suggestion with no luck :-(

I have more information for you:

FireFox error console detects the following error:

Code:
"Undefined is not a function"

This message goes away when I comment out the below lines:

Code:
//Configure Redirect
iu.addParam("RedirectURL", "test.cfm");

Could there be a problem with my JAR file? I have downloaded the latest file from the download area but I'm still having the same problem.

I have tried this on 3 computers with the same result... Is there another way that I can try to redirect after the upload is complete? I have tried the "if (Status=="COMPLETE")" method also to no avail...

I just don't understand why it works in IE (ActiveX) and not Java...

Alex Makhov  
#4 Posted : Friday, January 19, 2007 6:18:24 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups: Member
Joined: 8/3/2003(UTC)
Posts: 998

Hello,

You have specified the property in a wrong case. Here is your code:

Code:
iu.addParam("RedirectURL", "test.cfm");

And here is the right one (I suppose):

Code:
iu.addParam("RedirectUrl", "test.cfm");

So the reason of the problem could be case sensitivity of properties. Try the second variant in your code.

Edited by user Wednesday, February 20, 2008 4:13:29 PM(UTC)  | Reason: Not specified

Sincerely yours,

Alex Makhov

UserPostedImage Follow Aurigma on Twitter!

Phive_  
#5 Posted : Sunday, January 21, 2007 1:48:14 PM(UTC)
Phive_

Rank: Member

Groups: Member
Joined: 1/17/2007(UTC)
Posts: 7

Thanks again for the reply, but still no luck :-(

I am going to post the entire code from my this page hoping this will help..

This is an included template using <cfinclude>:

Code:
<!--- Image Uploader Script --->
<script type="text/javascript" src="../../Scripts/ImgUload/iuembed.js"></script>

<!--- HTML (Upload Table) --->
<table width="95%" border="0" cellspacing="1" cellpadding="1">
<tr>
	<td>
<!--- JavaScript --->
<script type="text/javascript">
//<![CDATA[	
//Create JavaScript object that will embed Image Uploader to the page.
var iu = new ImageUploaderWriter("ImageUploader1", 650, 400);


//For ActiveX control full path to CAB file (including file name) should be specified.
iu.activeXControlCodeBase = "../../Scripts/ImgUload/ImageUploader4.cab";
iu.activeXControlVersion = "4,1,1,0";

//For Java applet only path to directory with JAR files should be specified (without file name).
iu.javaAppletCodeBase = "../../Scripts/ImgUload/";
iu.javaAppletCached = true;
iu.javaAppletVersion = "2.1.1.0";

iu.showNonemptyResponse = "off";

//Configure appearance and behaviour.
iu.addParam("PaneLayout", "TwoPanes");
iu.addParam("ShowDebugWindow", "true");
iu.addParam("ShowDescriptions", "false");
iu.addParam("BackgroundColor", "#ffffff");

//Configure Image Uploader to rotate photos automatically 
//according to the orientation stored in EXIF metadata.
iu.addParam("EnableAutoRotate", "true");

//Configure file mask to upload JPEG images only.
iu.addParam("FileMask", "*.jpeg;*.jpg;*.jpe");

//Set image size restrictions.
iu.addParam("MinImageWidth", "150");
iu.addParam("MinImageHeight", "150");

//Exclude the source file from upload because only 
//resized versions of the photo will be sent.
iu.addParam("UploadSourceFile", "false");

//Configure settings of the optimized image. Optimized image
//is resized to 1200x1200 with JPEG quality = 75 and EXIF 
//metadata is preserved.
iu.addParam("UploadThumbnail1FitMode", "Fit");
iu.addParam("UploadThumbnail1Width", "650");
iu.addParam("UploadThumbnail1Height", "650");
iu.addParam("UploadThumbnail1JpegQuality", "75");
iu.addParam("UploadThumbnail1CopyExif", "true");

//Configure thumbnail settings.
iu.addParam("UploadThumbnail2FitMode", "Fit");
iu.addParam("UploadThumbnail2Width", "120");
iu.addParam("UploadThumbnail2Height", "120");
iu.addParam("UploadThumbnail2JpegQuality", "75");

//Configure URL files are uploaded to.
iu.addParam("Action", "Tmplts/ImgUload/upload.cfm");
//Configure Rediret
iu.addParam("RedirectUrl", "test.cfm");

//Add event handlers.
iu.addEventListener("UploadFileCountChange", "ImageUploader_UploadFileCountChange");
iu.addEventListener("Progress", "ImageUploader_Progress");

//Tell Image Uploader writer object to generate all necessary HTML code to embed 
//Image Uploader to the page.
iu.writeHtml();
//]]>
</script></td>
</tr>
</table>

Also, here is the latest output from Java Console:

Code:

ImageUploader version: 2.1.1
Current document URL: http://devhome/Members/Welcome/?EditPic&CrNew&Site=99
Reading cookies
Cookies: CFTOKEN=51051005; IWILLUID=brian%5Fweed%40hotmail%2Ecom; CFID=3101; IWILLREMCKTST=CookiesOK
Reading referer
Referer: http://devhome/Members/Welcome/?EditPic&CrNew&Site=99
Reading additional form content
Uploading to http://devhome/Members/Welcome/Tmplts/ImgUload/upload.cfm
Setting HTTP params: Host=devhome
Starting upload
Status =[200]
Jan 22, 2007 12:39:22 AM org.apache.commons.httpclient.HttpMethodBase getResponseBody
WARNING: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
Upload complete. Result page:
<META NAME="ColdFusionMXEdition" CONTENT="ColdFusion DevNet Edition - Not for Production Use.">

--> BLANK SPACE <--

EndOf Result page

Edited by user Wednesday, February 20, 2008 4:14:04 PM(UTC)  | Reason: Not specified

Alex Makhov  
#6 Posted : Sunday, January 21, 2007 3:25:06 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups: Member
Joined: 8/3/2003(UTC)
Posts: 998

Hello,

Is it the whole page code.

Are there the UploadFileCountChange and Progress event handlers which named ImageUploader_UploadFileCountChange and ImageUploader_Progress according to the following lines of your code?

Code:
iu.addEventListener("UploadFileCountChange", "ImageUploader_UploadFileCountChange");
iu.addEventListener("Progress", "ImageUploader_Progress");

Edited by user Wednesday, February 20, 2008 4:14:20 PM(UTC)  | Reason: Not specified

Sincerely yours,

Alex Makhov

UserPostedImage Follow Aurigma on Twitter!

Phive_  
#7 Posted : Sunday, January 21, 2007 5:58:32 PM(UTC)
Phive_

Rank: Member

Groups: Member
Joined: 1/17/2007(UTC)
Posts: 7

No, that's all the javascript that I have on my page (including the unmodified "iuembed.js").

Thank you again for all your help, your saving me from pulling out ALL of my hair!

:-)

Phive_  
#8 Posted : Sunday, January 21, 2007 6:03:06 PM(UTC)
Phive_

Rank: Member

Groups: Member
Joined: 1/17/2007(UTC)
Posts: 7

Alex Makhov - YOU ARE A GENIUS!!!!!!!!

I removed the two lines of code - and it worked like magic!

Thank you so much for all your help on this, you have saved your company a sale (we intended to buy the Image Uploader once we go live).

Thank you again!

Brian.

Users browsing this topic
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.