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

Notification

Icon
Error

Options
Go to last post Go to first unread
Hacim  
#1 Posted : Tuesday, September 26, 2006 12:26:36 PM(UTC)
Hacim

Rank: Member

Groups: Member
Joined: 6/21/2006(UTC)
Posts: 15

Hello, These forums have provided me with alot of support, thank you.. I am using the following code to automatically add a default number of copies and size.
Code:
oldUploadFileCount=0;
newUploadFileCount=0;
function ImageUploader_UploadFileCountChange(){

	var imageUploader2 = getImageUploader("ImageUploader2");
	if (imageUploader2){
		

	


	var newUploadFileCount = imageUploader2.getUploadFileCount();		

			for (var i = oldUploadFileCount + 1; i <= newUploadFileCount; i++)
			{	
			
				imageUploader2.setUploadFileDescription(i, "4x6 1");
			}
		oldUploadFileCount = newUploadFileCount;

	}



}
that works perfectly, however when i go back to submit more copies i get the following error: Object doesn't support this property or method. My error comes from this line. var newUploadFileCount = imageUploader2.getUploadFileCount(); Is there any way to reset the imageUploader2.getUploadFileCount();

Edited by user Thursday, February 21, 2008 10:34:26 PM(UTC)  | Reason: Not specified

Alex Makhov  
#2 Posted : Tuesday, September 26, 2006 1:01:53 PM(UTC)
Alex Makhov

Rank: Advanced Member

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

Hello, It looks like imageUploader2 is null or undefined at that moment. Please check it; I think that is a reason of your problem.
Sincerely yours, Alex Makhov UserPostedImage Follow Aurigma on Twitter!
Hacim  
#3 Posted : Tuesday, September 26, 2006 1:57:44 PM(UTC)
Hacim

Rank: Member

Groups: Member
Joined: 6/21/2006(UTC)
Posts: 15

Hi Alex, I checked the code and you are correct... How do i go about making sure imageuploader2 is not set to null or undefined there Regards
Alex Makhov  
#4 Posted : Tuesday, September 26, 2006 3:53:19 PM(UTC)
Alex Makhov

Rank: Advanced Member

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

Hello, You should move imageuploader2 initialization code somewhere to ensure it is initialized every time you use it.
Sincerely yours, Alex Makhov UserPostedImage Follow Aurigma on Twitter!
Hacim  
#5 Posted : Tuesday, September 26, 2006 7:03:01 PM(UTC)
Hacim

Rank: Member

Groups: Member
Joined: 6/21/2006(UTC)
Posts: 15

Hello,
Code:
function fullPageLoad(){	
	imageUploader2=getImageUploader("ImageUploader2");
}
Im assuming that this is the initilization code. (Im unsure) ive made sure that there is references to the imageUploader2=getImageUploader("ImageUploader2"); in each function However in functions that have imageUploader2.getUploadFileCount(); i get errors What code is used to initilize imageuploader? Regards Hacim

Edited by user Thursday, February 21, 2008 10:34:57 PM(UTC)  | Reason: Not specified

Alex Makhov  
#6 Posted : Wednesday, September 27, 2006 5:08:27 PM(UTC)
Alex Makhov

Rank: Advanced Member

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

Hello, Try to debug it to watch the value of getImageUploader function result. There is definitely some error, some incorrect piece of code or something. Try to comment some parts of code to find the place where is the reason of the problem. May be you should change the order of functions and member definitions.
Sincerely yours, Alex Makhov UserPostedImage Follow Aurigma on Twitter!
stark77  
#7 Posted : Tuesday, March 13, 2007 10:07:42 AM(UTC)
stark77

Rank: Member

Groups: Member
Joined: 10/29/2006(UTC)
Posts: 21

Hi, I'm having similar problems as those mentioned in this thread. I definitely have the correct object because I can read back other properties such as the Action for the uploader. Also, the code works perfectly in Firefox, but the problem is in IE6. I get the same error "object doesn't support this property or method" when I try to check the number of files added using getUploadFileCount() I could try and track the number myself using the events that are fired when adding/removing files, but I am expecting large numbers of files to be added at a time, and I don't want to slow that down any more than necessary. The relevant code is:
Code:
	var iu = new ImageUploaderWriter("ImageUploader", 700, 240);

	iu.activeXControlEnabled = true;
	iu.javaAppletEnabled = true;

	iu.activeXControlCodeBase = "/ImageUploader4.cab";
	iu.javaAppletCodeBase="/";

	iu.javaAppletCached=false;

	iu.addParam("LicenseKey", "xxx");

	iu.addParam("BackgroundColor", "#becdde");

	iu.addParam("PaneLayout", "OnePane");
	iu.addParam("UploadView", "List");
	iu.addParam("FolderView", "List");
	iu.addParam("ShowButtons", "false");


	iu.addParam("AllowAutoRotate", "true");
	iu.addParam("AllowFolderUpload", "true");
	iu.addParam("EnableRotate", "false");

	iu.addParam("FileMask", "*.jpg;*.jpeg;*.bmp;*.gif;*.psd;*.png");
	iu.addParam("ProgressDialogEstimatedTimeText", "");

	iu.addParam("UploadSourceFile", "false");
	iu.addParam("MessageUploadCompleteText", "Photos have been uploaded. You will now be taken to an upload summary page.");

	iu.addParam("UploadThumbnail1FitMode", "Fit");
	iu.addParam("UploadThumbnail1Width", "600");
	iu.addParam("UploadThumbnail1Height", "600");
	iu.addParam("UploadThumbnail1JpegQuality", "80");

	iu.addParam("MaxImageWidth", "0");
	iu.addParam("MinImageWidth", "0");
	iu.addParam("MaxImageHeight", "0");
	iu.addParam("MinImageHeight", "0");
	iu.addParam("SignatureFilter", "All");

	iu.addParam("MaxFileCount", "500");

	iu.addParam("LoadingFilesText", "Your files are being loaded into the browser for upload, please wait a moment...");

	iu.addParam("DropFilesHereText", "Either click on one of the buttons above to select the files that you want to upload, or simply drag them into this area.");

	iu.addParam("FilesPerOnePackageCount", 5);

	iu.addEventListener("InitComplete", "ImageUploaderID_InitComplete");

	iu.addEventListener("Progress", "ImageUploaderID_Progress");

	iu.writeHtml();


        function showPreUpload()
        {
	         var theUploader = getImageUploader("ImageUploader");

	         alert(theUploader.Action);  // this line works fine showing that I have the correct object although returns "undefined" in Firefox

	         numFilesSelected = theUploader.getUploadFileCount(); // this line works in FF, fails with IE6

                 alert(numFilesSelected);
        }
Any thoughts?

Edited by user Thursday, February 21, 2008 10:35:21 PM(UTC)  | Reason: Not specified

Alex Makhov  
#8 Posted : Tuesday, March 13, 2007 2:09:55 PM(UTC)
Alex Makhov

Rank: Advanced Member

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

Hello, You will be surprised but the following line of your code is wrong:
Code:
theUploader.Action
and this line is correct:
Code:
theUploader.getAction()
It does not work in your case because of this line of code where you specify the direct listener for InitComplete event:
Code:
iu.addEventListener("InitComplete", "ImageUploaderID_InitComplete");
You should replace it with the following line of code (which is functionally the same):
Code:
iu.fullPageLoadListenerName = "ImageUploaderID_InitComplete";
Please make these changes, it should work.
Sincerely yours, Alex Makhov UserPostedImage Follow Aurigma on Twitter!
stark77  
#9 Posted : Wednesday, March 14, 2007 2:22:18 AM(UTC)
stark77

Rank: Member

Groups: Member
Joined: 10/29/2006(UTC)
Posts: 21

Works perfectly now, thanks very much! :) Of course, now that I have the answer - I see the "remarks" section in the documentation for ImageUploader.InitComplete Event where it suggests using fullPageLoadListenerName. Sorry for not reading the documentation properly, and thanks again for the very prompt reply.
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.