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

Notification

Icon
Error

Options
Go to last post Go to first unread
ofer  
#1 Posted : Tuesday, March 20, 2007 5:16:34 PM(UTC)
ofer

Rank: Member

Groups: Member
Joined: 9/6/2005(UTC)
Posts: 6

my code stoped working

i"m using version "3,0,825,0"
when i use getImageUploader("ImageUploader1").getUploadFileCount() i get js error

thanks
ofer
Fedor  
#2 Posted : Wednesday, March 21, 2007 2:22:59 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,537

Thanks: 4 times
Was thanked: 56 time(s) in 55 post(s)
Ofer,

What exactly error do you receive?
Best regards,
Fedor Skvortsov
cjarvis  
#3 Posted : Wednesday, March 28, 2007 5:35:01 AM(UTC)
cjarvis

Rank: Member

Groups: Member
Joined: 2/2/2007(UTC)
Posts: 9

I am using version '4,0,47,0'

This line also mysteriously stopped working for me as well.
I get the Microsoft JScript runtime error: Object doesn't support this property or method error. Any ideas?
cjarvis  
#4 Posted : Wednesday, March 28, 2007 5:46:48 AM(UTC)
cjarvis

Rank: Member

Groups: Member
Joined: 2/2/2007(UTC)
Posts: 9

I found why this stopped working, but not the cause. When I add an event listener to InitComplete event, getUploadFileCount stops working.

Here is the code to add the listner...
Code:
iu.addEventListener('BeforeUpload', 'ImageUploader_BeforeUpload');


Here is my js function...
Code:
function ImageUploaderID_InitComplete() {
    var imageUploader = getImageUploader("ImageUploader");
    imageUploader.GoToFolder("MyComputer");
}


Even when I comment out the lines of code in the handler, this error still occurs.

Edited by user Friday, February 22, 2008 2:50:28 PM(UTC)  | Reason: Not specified

George Ulyanov  
#5 Posted : Wednesday, March 28, 2007 1:27:04 PM(UTC)
George Ulyanov

Rank: Advanced Member

Groups: Member
Joined: 7/26/2006(UTC)
Posts: 203

Hello,

Please post the entire code of your page.

Edited by user Friday, February 22, 2008 2:52:47 PM(UTC)  | Reason: Not specified

Best regards,
George Ulyanov
cjarvis  
#6 Posted : Thursday, March 29, 2007 4:36:11 AM(UTC)
cjarvis

Rank: Member

Groups: Member
Joined: 2/2/2007(UTC)
Posts: 9

Initial config...
(Using a string builder)

Code:
        javaScript.Append("<script type='text/javascript'>");
        javaScript.Append("var IMAGE_UPLOAD_URL ='" + ConfigurationManager.AppSettings["IMAGE_UPLOAD_URL"] + "';");
        javaScript.Append("var THUMBNAIL_UPLOAD_URL = '" + ConfigurationManager.AppSettings["THUMBNAIL_UPLOAD_URL"] + "';");
        javaScript.Append("var iu = new ImageUploaderWriter('ImageUploader1', 640, 480);");
        javaScript.Append("iu.activeXControlCodeBase = '../ImageUploading/ImageUploader4.cab';");
        javaScript.Append("iu.activeXControlVersion = '4,0,47,0';");
        javaScript.Append("iu.javaAppletCodeBase = '../';");
        javaScript.Append("iu.javaAppletCached = true;");
        javaScript.Append("iu.javaAppletVersion = '2.0.50.0';");
        javaScript.Append("iu.showNonemptyResponse = 'off';");
        javaScript.Append("iu.addParam('PaneLayout', 'ThreePanes');");
        javaScript.Append("iu.addParam('FolderPaneHeight', '160');");
        javaScript.Append("iu.addParam('ShowDebugWindow', 'false');");
        javaScript.Append("iu.addParam('AllowMultipleRotate', 'true');");
        javaScript.Append("iu.addParam('AllowMultipleRemove', 'true');");
        javaScript.Append("iu.addParam('MessageUploadCompleteText', '');");
        javaScript.Append("iu.addParam('ButtonSendText', '');");
        javaScript.Append("iu.addParam('ShowDescriptions', 'false');");
        javaScript.Append("iu.addParam('SplitterLineStyle', 'Solid');");
        javaScript.Append("iu.addParam('FileMask', '*.jpg;*.jpe;*.jpeg;*.gif;*.bmp;*.png;*.tif;*.tiff');");
        javaScript.Append("iu.addParam('UploadSourceFile', 'false');");
        javaScript.Append("iu.addParam('UploadThumbnail1FitMode', 'Fit');");
        javaScript.Append("iu.addParam('UploadThumbnail1Height', '120');");
        javaScript.Append("iu.addParam('UploadThumbnail1Width', '160');");
        javaScript.Append("iu.addParam('UploadThumbnail1JpegQuality', '100');");
        javaScript.Append("iu.addParam('UploadThumbnail1ResizeQuality', 'High');");
        javaScript.Append("iu.addParam('UncheckUploadedFiles', 'false');");
        javaScript.Append("iu.addParam('Action', THUMBNAIL_UPLOAD_URL);");
        javaScript.Append("iu.addEventListener('BeforeUpload', 'ImageUploader_BeforeUpload');");
        javaScript.Append("iu.addEventListener('Progress', 'ImageUploader_Progress');");
        //javaScript.Append("iu.addEventListener('InitComplete', 'ImageUploaderID_InitComplete');");
        javaScript.Append("iu.writeHtml();");
        javaScript.Append("</script>");

Events...
//The following section contains image uploader specific functions
function ImageUploaderID_InitComplete() {
    var imageUploader1 = getImageUploader("ImageUploader1");
    imageUploader1.GoToFolder("MyComputer"); 
}

function ImageUploader_BeforeUpload(){
    var imageUploader1 = getImageUploader("ImageUploader1");
    imageUploader1.AddField("WorkOrderId", document.getElementById("HiddenFieldWorkOrderId").value);
	var imageCount = imageUploader1.getUploadFileCount();
		
	for (var i = 1; i <= imageCount; i++){
	    imageUploader1.setUploadFileDescription(i,imageUploader1.getUploadFileGuid(i));
	}
}

function ImageUploader_Progress(Status, Progress, ValueMax, Value, StatusText) {
	var imageUploader1 = getImageUploader("ImageUploader1");
	var currentAction = imageUploader1.getAction();
	if(Status == 'COMPLETE' && currentAction == THUMBNAIL_UPLOAD_URL) {
	    imageUploader1.setAction(IMAGE_UPLOAD_URL);
	    imageUploader1.setUncheckUploadedFiles(true);
	    imageUploader1.setUploadThumbnail1Height(480);
	    imageUploader1.setUploadThumbnail1Width(640);
	    imageUploader1.Send();
	}
	if(Status == 'COMPLETE' && currentAction == IMAGE_UPLOAD_URL) {
	    imageUploader1.setAction(THUMBNAIL_UPLOAD_URL);
	    imageUploader1.setUncheckUploadedFiles(false);
	    imageUploader1.setUploadThumbnail1Height(120);
	    imageUploader1.setUploadThumbnail1Width(160);
	    CloseUploadPopUp();    
	}
	if(Status == 'ERROR') {
	    alert("An error occurred when uploading your image(s)");
	    CloseUploadPopUp();
	}
}


If I subscribe to the InitComplete event by removing the commented line, getUploadFileCount() in function ImageUploader_BeforeUpload() will begin throwing an exception. All of the events have valid and accessible javascript functions. Please let me know what you find, thanks.

Edited by user Tuesday, December 18, 2007 4:11:38 PM(UTC)  | Reason: Not specified

George Ulyanov  
#7 Posted : Thursday, March 29, 2007 2:58:34 PM(UTC)
George Ulyanov

Rank: Advanced Member

Groups: Member
Joined: 7/26/2006(UTC)
Posts: 203

Hello,

I have implemented the same code but without a string builder and it has worked perfectly.

Please check whether my script works perfectly on your side.

Edited by user Friday, February 22, 2008 2:52:18 PM(UTC)  | Reason: Not specified

Best regards,
George Ulyanov
George Ulyanov  
#8 Posted : Thursday, March 29, 2007 2:59:46 PM(UTC)
George Ulyanov

Rank: Advanced Member

Groups: Member
Joined: 7/26/2006(UTC)
Posts: 203

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Aurigma Image Uploader - Basic Demo</title>
<script type="text/javascript" src="../iuembed.js"></script>
<link href="style.css" type="text/css" rel="stylesheet" />
</head>

<body>

<select id="selecta1" name="selecta1">
<option value="15" selected>15</option>
</select>

<script type="text/javascript">

var iu = new ImageUploaderWriter("ImageUploader1", 650, 400);

iu.activeXControlCodeBase = "../ImageUploader4.cab";
iu.activeXControlVersion = "4,1,1,0";

iu.javaAppletCodeBase = "../";
iu.javaAppletCached = true;
iu.javaAppletVersion = "2.1.32.0";
iu.showNonemptyResponse = 'off';


iu.addParam('PaneLayout', 'ThreePanes');
iu.addParam('FolderPaneHeight', '160');
iu.addParam('ShowDebugWindow', 'false');
iu.addParam('AllowMultipleRotate', 'true');
iu.addParam('AllowMultipleRemove', 'true');
iu.addParam('MessageUploadCompleteText', '');
//iu.addParam('ButtonSendText', '');			// I need possibility to send the files.
iu.addParam('ShowDescriptions', 'false');
iu.addParam('SplitterLineStyle', 'Solid');
iu.addParam('FileMask', '*.jpg;*.jpe;*.jpeg;*.gif;*.bmp;*.png;*.tif;*.tiff');
iu.addParam('UploadSourceFile', 'false');
iu.addParam('UploadThumbnail1FitMode', 'Fit');
iu.addParam('UploadThumbnail1Height', '120');
iu.addParam('UploadThumbnail1Width', '160');
iu.addParam('UploadThumbnail1JpegQuality', '100');
iu.addParam('UploadThumbnail1ResizeQuality', 'High');
iu.addParam('UncheckUploadedFiles', 'false');
//iu.addParam('Action', THUMBNAIL_UPLOAD_URL);		// I don't have this value :)
iu.addEventListener('BeforeUpload', 'ImageUploader_BeforeUpload');
iu.addEventListener('Progress', 'ImageUploader_Progress');
iu.addEventListener('InitComplete', 'ImageUploaderID_InitComplete');
iu.writeHtml();

function ImageUploaderID_InitComplete()
{
	var imageUploader1 = getImageUploader("ImageUploader1");
//	imageUploader1.GoToFolder("MyComputer"); 
}

function ImageUploader_BeforeUpload()
{
	var imageUploader1 = getImageUploader("ImageUploader1");

	var val = document.getElementById("selecta1").value;
	imageUploader1.AddField("WorkOrderId", val);
	var imageCount = imageUploader1.getUploadFileCount();
	alert (imageCount);
	for (var i = 1; i <= imageCount; i++)
	{
		imageUploader1.setUploadFileDescription(i,imageUploader1.getUploadFileGuid(i));
	}
}

function ImageUploader_Progress(Status, Progress, ValueMax, Value, StatusText)
{
}

</script>
</body>
</html>

Edited by user Friday, February 22, 2008 2:51:20 PM(UTC)  | Reason: Not specified

Best regards,
George Ulyanov
cjarvis  
#9 Posted : Thursday, April 19, 2007 4:25:23 AM(UTC)
cjarvis

Rank: Member

Groups: Member
Joined: 2/2/2007(UTC)
Posts: 9

Sorry for the delay in my response.
This does work for us when not embedded in a placeholder tag, without using a string builder. However, due to security, configuration, and layout/display reasons, we need to generate the javascript in the code behind, create a literal with the generated javascript, and then add the literal to a placeholder. Doing this will cause the behavior descibed above.

Since the functionality we need in this event is not mission critical, we have simply stopped subscribing to the InitComplete event.

Any ideas why using a literal within a placeholder would cause this to fail. (Also, this also occurs for any method, not just getUploadFileCount. It seems to find the object, but is unable to call any method/set any property if we subscribe to the InitComplete event.
File2Share  
#10 Posted : Tuesday, May 05, 2009 5:45:28 PM(UTC)
File2Share

Rank: Newbie

Groups: Member
Joined: 12/16/2008(UTC)
Posts: 3

Sorry to revive an old topic, but I have exactly this issue:

- ImageUploader is written to the page by a Javascript function when a user clicks a button.
- To be able to show the user a `loading' message, the InitComplete event is used to determine when `loading' is done.
- After this, using some of the methods on the ImageUploader object (via getImageUploader("name") function) results in the error: "Error: Object doesn't support this property or method".

Not all methods are affected, the AddFiles() method still works, for example, but all the getProperty() methods are broken.


As this is a relatively old thread, I'm wondering if there's a known workaround or fix. I've tried using the fullPageListener, but as the code is loaded at a later time, this doesn't work properly.

I'm using version 5.7.14.0 of ImageUploader Dual, the problem only exists in the ActiveX version.
Dmitry  
#11 Posted : Friday, May 08, 2009 4:53:43 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello,

Thanks for your report.

The problem will be fixed in version 6 that will be available in the nearest time.
Sincerely yours,
Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!
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.