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

Notification

Icon
Error

Options
Go to last post Go to first unread
ndonnan  
#1 Posted : Wednesday, July 8, 2009 8:58:29 PM(UTC)
ndonnan

Rank: Newbie

Groups: Member
Joined: 6/19/2009(UTC)
Posts: 3

Hi there,

I am trying to get the filename of a file being uploaded in the current package in the "PackageBeforeUpload" event function.

I have set "FilesPerOnePackageCount" to 1.

The following does not seem to be working:

Code:
window.ImageUploader1_PackageBeforeUpload = function(packageIndex){
    var uploader = getImageUploader("ImageUploader1");
    console.log("package upload: " + packageIndex);
    uploader.getUploadFileName(packageIndex + 1);
};

The filenames are sometimes out of sync with what is being uploaded, I guess because the packages may not upload in the same order as the files in the uploader?

Thanks in advance.

Neal.

Edited by user Thursday, July 9, 2009 1:57:03 AM(UTC)  | Reason: Not specified

Tamila  
#2 Posted : Thursday, July 9, 2009 5:58:44 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 Neal,

I have modified your code and now it woks well:

Code:
<script type="text/javascript">
var iu = new ImageUploaderWriter("ImageUploader1", "800", "600");
//other params...

iu.addParam("FilesPerOnePackageCount", "1");
iu.addEventListener("PackageBeforeUpload", "ImageUploader_PackageBeforeUpload");
//other params...

iu.writeHtml();

function ImageUploader_PackageBeforeUpload(PackageIndex) 
{
	var uploader = getImageUploader("ImageUploader1");
      var name = uploader.getUploadFileName(1);
	alert(name);
}
</script>

I hope it helps you.

Edited by user Thursday, July 9, 2009 5:59:35 PM(UTC)  | Reason: Not specified

Aurigma Support Team

UserPostedImage Follow Aurigma on Twitter!

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