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

Notification

Icon
Error

Options
Go to last post Go to first unread
smandros  
#1 Posted : Thursday, April 24, 2008 6:18:08 AM(UTC)
smandros

Rank: Member

Groups: Member
Joined: 9/21/2007(UTC)
Posts: 12

I am using Image Uploader 4.7. I have the following question:

Is there any way to alter the RedirectUrl after the control was initially rendered? We need to pass different query string depending on the different document type that is uploaded. I have the following code that is setting up “Action” and “RedirectURL” parameters.


var uploadURL = path + "?Action=Upload"
var redirectURL= path + "?Action=Result”

//Configure URL files are uploaded to.
iu.addParam("Action", uploadURL);
//Configure URL where to redirect after upload.
iu.addParam("RedirectUrl", redirectURL);

My problem is, that when the control is rendered I do not know the additional information as Document Type that user is going to upload. There is a drop down box on the screen with the list of document types. A user selects the type of the document, selects the files and then uploads the files using your control. But at that moment I can not alter the query string since the control is already rendered.

Any ideas, what I could do?

Sincerely, smandros
Brick wall
Eugene Kosmin  
#2 Posted : Thursday, April 24, 2008 12:07:29 PM(UTC)
Eugene Kosmin

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 9/19/2006(UTC)
Posts: 446

Was thanked: 24 time(s) in 24 post(s)
Hello Smandros,

You can change RedirectUrl property from BeforeUpload event handler or change window location from AfterUpload handler. I.e. something like this:

Code:

function ImageUploader_AfterUpload(Page)
{	
     getImageUploader("ImageUploader").setRedirectUrl(_redirectPage);
     window.location = _redirectPage;
}

function ImageUploader_BeforeUpload()
{
     getImageUploader("ImageUploader").setRedirectUrl(_redirectPage);
}

var iu = new ImageUploaderWriter("ImageUploader", 800, 600);

// other properties

// These two handlers give completely the same result. 
//iu.addEventListener("AfterUpload", "ImageUploader_AfterUpload");
iu.addEventListener("BeforeUpload", "ImageUploader_BeforeUpload");

iu.writeHtml();
Best regards,
Eugene Kosmin.
Aurigma Development Team
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.