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

Notification

Icon
Error

Options
Go to last post Go to first unread
Richardcanoe  
#1 Posted : Sunday, January 21, 2007 7:07:47 PM(UTC)
Richardcanoe

Rank: Member

Groups: Member
Joined: 3/10/2006(UTC)
Posts: 7

Alex,

We would like to forward our users to an upgrade page when they reach their initial limit. Currently an alert warns them that they have reached their limit and that they must upgrade, but they then have to manually navigate to the upgrade page. Is there any way of doing this when the alert box is closed?

Thanks
Rich
Alex Makhov  
#2 Posted : Monday, January 22, 2007 7:02:24 PM(UTC)
Alex Makhov

Rank: Advanced Member

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

Hello Rich,

You should handle the Progress event to implement the specified behavior. There is an error code which is not specified in Image Uploader documentation: When the user tries to select the files with too large total file size the Progress event is fired with the Status=="ERROR" and Value == 8. So you could handle it to redirect a user to some another page. Also you should disable MessageMaxTotalFileSizeExceeded message by setting the MessageMaxTotalFileSizeExceededText property value to an empty string.
Here is the code:
Code:
function ImageUploader_Progress(Status, Progress, ValueMax, Value, StatusText)
{
	if (Status == "ERROR" && Value == 8)
	{
		alert("MaxFileSize exceeded!");
		window.location = 'someAnotherPage.html';  
	}
}
…
iu.addParam("MaxTotalFileSize", "100000");
iu.addParam("MessageMaxTotalFileSizeExceededText", "");
iu.addEventListener("Progress", "ImageUploader_Progress");

Edited by user Wednesday, February 20, 2008 5:57:08 PM(UTC)  | Reason: Not specified

Sincerely yours,
Alex Makhov

UserPostedImage Follow Aurigma on Twitter!
Richardcanoe  
#3 Posted : Tuesday, January 23, 2007 7:07:50 PM(UTC)
Richardcanoe

Rank: Member

Groups: Member
Joined: 3/10/2006(UTC)
Posts: 7

Thanks Alex, great result.

Problem is that if you reach your limit by clicking 'Select All' the alert box comes up for every file over the limit. Is there any way of escaping if ImageUploader_Progress has been called once already?

Thanks
Rich
Alex Makhov  
#4 Posted : Tuesday, January 23, 2007 7:29:28 PM(UTC)
Alex Makhov

Rank: Advanced Member

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

Hello,

It looks like there is some bug. We will fix it in one of the next releases but now you will have to handle it in some way by using JavaScript.
Sincerely yours,
Alex Makhov

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.