There are two ways to implement it:
1st WayWe 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 WayOn 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"){
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);
iu.addEventListener("UploadFileCountChange", "ImageUploaderID_UploadFileCountChange");
iu.writeHtml();
</script>
Code:
<script type="text/javascript" src="iuembed.js"></script>
<script type="text/javascript">
function ImageUploaderID_Progress(Status, Progress, ValueMax, Value, StatusText) {
window.location="MyRedirectPage.asp?filecount=" + StatusText;
}
var iu = new ImageUploaderWriter("ImageUploaderID", 610, 500);
iu.addEventListener("Progress", "ImageUploaderID_Progress");
iu.writeHtml();
</script>
========================================================
Best regards,
Fedor Skvortsov