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

Notification

Icon
Error

Options
Go to last post Go to first unread
sedmanphoto  
#1 Posted : Monday, April 19, 2010 10:49:51 AM(UTC)
sedmanphoto

Rank: Newbie

Groups: Member
Joined: 6/29/2009(UTC)
Posts: 5

Hi,

I'm having a problem with the UploadFileRemove method. My function ImageUploader1_UploadFileCountChange loops through each the files in the upload windows and removes any files thats not in an array I have defined. The problem I'm having is when I drag a folder on to the upload window it removes all files that were in that folder. This works fine if I drag only images into the upload window.

Image Uploader Version: 6.5.6 Java

OS: OS X 10.5

Browsers: Firefox 3.5

OS: Windows XP

Browsers: Firefox 3.5, Internet Explorer 7, Safari 4.0.2

Example Code:

Code:


var ImageList = new Array("b0001.jpg","b0003.jpg","b0004.jpg","b0005.jpg");


function oc(a){
	var o = {};
	for(var i=0;i<a.length;i++){
		o[a[i]]='';
	}
	return o;
}

function ImageUploader1_UploadFileCountChange() {
	
	removeFiles();

	//...

}


function removeFiles() {
	
	var imageUploader = getImageUploader("ImageUploader1");

	for(var i=imageUploader.getUploadFileCount(); i >= 1; i--){
		
		var cur_image = imageUploader.getUploadFileName(i).toLowerCase();
		
		if(cur_image in oc(ImageList)){}else{

			imageUploader.UploadFileRemove(i);
		};
		
	};

}


Thanks.

Edited by user Monday, April 19, 2010 11:14:11 AM(UTC)  | Reason: Not specified

Tamila  
#2 Posted : Thursday, April 22, 2010 6:53:05 PM(UTC)
Tamila

Rank: Advanced Member

Groups: Member
Joined: 3/9/2008(UTC)
Posts: 554

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

We reproduced the problem. Unfortunately Image Uploader Java has a bug. The following code allows to you to workaround this problem in both Uploaders (ActiveX and Java):

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

//params

if (iu.getControlType() == "Java")
{
	iu.addParam("ShowSubfolders", "false");
}
iu.addParam("AllowFolderUpload", "false");
iu.addParam("ShowSubfolders", "true");

//other params

iu.writeHtml();


// this is your code
var ImageList = new Array("b0001.jpg","b0003.jpg","b0004.jpg","b0005.jpg");

function oc(a){
    var o = {};
    for(var i=0;i<a.length;i++){
        o[a[i]]='';
    }
    return o;
}

function ImageUploader1_UploadFileCountChange() {

    removeFiles();
    //...
}

function removeFiles() {
    var imageUploader = getImageUploader("ImageUploader1");
    for(var i=imageUploader.getUploadFileCount(); i >= 1; i--){
        var cur_image = imageUploader.getUploadFileName(i).toLowerCase();
        if(cur_image in oc(ImageList)){}else{
            imageUploader.UploadFileRemove(i);
        };
    };
}

Anyway, our developers will fix the issue in future releases. Thank you for bug report.

Edited by user Thursday, April 22, 2010 6:54:46 PM(UTC)  | Reason: Not specified

Aurigma Support Team

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.