Hi Please use following:
Server side
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static object GetUploadStatus()
{
UploadDetail info = (UploadDetail)HttpContext.Current.Session["UploadDetail"];
if (info != null && info.IsReady)
{
int soFar = info.UploadedLength;
int total = info.ContentLength;
int percentComplete = (int)Math.Ceiling((double)soFar / (double)total * 100);
string message = "Uploading...";
string fileName = string.Format("{0}", info.FileName);
string downloadBytes = string.Format("{0} of {1} Bytes", soFar, total);
return new
{
percentComplete = percentComplete,
message = message,
fileName = fileName,
downloadBytes = downloadBytes
};
}
return null;
}
Client side
PageMethods.GetUploadStatus(function(result) {
if (result) {
setProgress(result.percentComplete);
updateMessage(MessageStatus.Information, result.message, result.fileName, result.downloadBytes);
if (result == 100) {
window.clearInterval(intervalID);
clearTimeout(subintervalID);
}
}
});
You can find more help here....
ASP.NET File Upload with Progress Bar[
^]