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

Notification

Icon
Error

Options
Go to last post Go to first unread
Tamila  
#1 Posted : Wednesday, February 24, 2010 2:15:36 PM(UTC)
Tamila

Rank: Advanced Member

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

Was thanked: 1 time(s) in 1 post(s)
Quote:
I want to restrict my customers to upload pictures larger than 16 mega pixels. How to do it?

The following code demonstrates how to set restriction on picture resolution:

Code:
var iu = new ImageUploaderWriter("ImageUploader", 650, 400);
//other params...

iu.addEventListener("UploadFileCountChange", "ImageUploader_UploadFileCountChange");
//other params..

iu.writeHtml();


var _removeInProcess = false;

function removeLargeImages() {
    var iu = getImageUploader("ImageUploader");

    for (var i = iu.getUploadFileCount(); i >= 1; i--) {
        if (iu.getUploadFileHeight(i) * iu.getUploadFileWidth(i) > 16000000) {
            alert(iu.getUploadFileName(i) + " is greater than the 16 Mega pixel"
			+ "resolution limit and cannot be uploaded.");
            iu.UploadFileRemove(i);
        }
    }
    _removeInProcess = false;
}

function ImageUploader_UploadFileCountChange() {
    if (_removeInProcess) {
        return;
    }
    _removeInProcess = true;
    setTimeout('removeLargeImages()', 0);
}

See also:

Edited by user Wednesday, February 24, 2010 2:16:07 PM(UTC)  | Reason: Not specified

Aurigma Support Team

UserPostedImage Follow Aurigma on Twitter!

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