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

Notification

Icon
Error

Options
Go to last post Go to first unread
teja  
#1 Posted : Monday, January 31, 2005 6:37:00 AM(UTC)
teja

Rank: Member

Groups: Member
Joined: 1/31/2005(UTC)
Posts: 6

Hi, Can anyone tell me how I can get the number of files uploaded. I want this to be displayed in teh "redirectURL" page. How can I add this info dynamically to the page?? thanks, Teja
Fedor  
#2 Posted : Monday, January 31, 2005 4:33:00 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,482

Thanks: 3 times
Was thanked: 40 time(s) in 39 post(s)
There are two ways to implement it: 1st Way We can get count of uploaded files using UploadFileCount property. We can handle changing of this property using UploadFileCountChange event. In handler of this event we just need to update RedirectUrl property and pass file count to redirect page using query string:
Code:
<object id="ImageUploader1" ... >
...
</object>

<script for="ImageUploader1" event="UploadFileCountChange()">
ImageUploader1.RedirectUrl="MyRedirectPage.asp?filecount="+ImageUploader1.UploadFileCount;
</script>
2nd Way On server-side we can get file count from uploaded data using FileCount field. Upload processing page (the one specified in Action param) should return to browser the string which contains file count:
Code:
Response.Clear
Response.Write objUpload.Form("FileCount")
Response.End
On client side we need to set RedirectUrl property empty and make redirection manualy in Progress event handler:
Code:
<object id="ImageUploader1" ... >
<param name="RedirectUrl" value="">
</object>

<script for="ImageUploader1" event="Progress(Status, Progress, ValueMax, Value, StatusText)">
if (Status == "COMPLETE"){
    //StatusText contains response from  
    window.location="MyRedirectPage.asp?filecount=" + StatusText;
}
</script>
In both case we can easy show filecount on redirected page using following code:
Code:
<%
Response.Write Request.QueryString("filecount")
%>
======================================================== 02/14/2008, Fedor This topic is out of date. You should use iuembed.js syntax now.
Code:
<script type="text/javascript" src="iuembed.js"></script>
<script type="text/javascript">
function ImageUploaderID_UploadFileCountChange() {
	var upl = getimageUploader("ImageUploaderID");
	upl.setRedirectUrl("MyRedirectPage.asp?filecount=" + upl.getUploadFileCount());
}
var iu = new ImageUploaderWriter("ImageUploaderID", 610, 500);
//...params...
//...other event listeners...
iu.addEventListener("UploadFileCountChange", "ImageUploaderID_UploadFileCountChange");
//...other event listeners...
iu.writeHtml();
</script>
Code:
<script type="text/javascript" src="iuembed.js"></script>
<script type="text/javascript">
function ImageUploaderID_Progress(Status, Progress, ValueMax, Value, StatusText) {
    //StatusText contains response from server 
    window.location="MyRedirectPage.asp?filecount=" + StatusText;

}
var iu = new ImageUploaderWriter("ImageUploaderID", 610, 500);
//...params...
//...other event listeners...
iu.addEventListener("Progress", "ImageUploaderID_Progress");
//...other event listeners...
iu.writeHtml();
</script>
========================================================

Edited by user Wednesday, October 29, 2008 4:06:47 PM(UTC)  | Reason: Not specified

Best regards, Fedor Skvortsov
teja  
#3 Posted : Tuesday, February 01, 2005 12:33:00 AM(UTC)
teja

Rank: Member

Groups: Member
Joined: 1/31/2005(UTC)
Posts: 6

hi fedor, thaks a lot.. you solved my doubts.. regards, Teja
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.