I am using RADUplaod Telerik control
Issue : When i am trying to upload small file. The progress bar initially showed activity but did not update the percentage and then suddenly the entire file was uploaded and showing 100%. Can't we show the progress correctly. For the case of large file - it is showing progress till last 5 seconds left, then it stuck for 5 second and file got uploaded. I dont want to show 2 progress bars actually i want to show only 1 progress bar with smooth transition.
Can you please help me out to solve this issue.
Below are the code lines i wrote in my page.
(In *.aspx)
<telerik:RadUpload ID="Radupload1" runat="server" InitialFileInputsCount="1" TargetFolder="~Temp"
TargetPhysicalFolder="C:\Temp" ControlObjectsVisibility="None" />
<asp:Button ID="buttonSubmit" runat="server" Text="Upload" OnClientClick="SetFileFromUpload(); StopSessionTimers();return ValidateCheck()"
OnClick="buttonSubmit_Click" CssClass="btn" />
<telerik:RadProgressManager ID="Radprogressmanager1" runat="server" />
<telerik:RadProgressArea ID="RadProgressArea1" runat="server" Localization-EstimatedTime="Estimated time"
Localization-TransferSpeed="Speed" DisplayCancelButton="false" Width="375px" OnClientSubmitting="submit" OnClientProgressUpdating="RadProgressArea1_OnClientProgressUpdating" ProgressIndicators="TransferSpeed,TimeEstimated,TimeElapsed,FilesCountBar,FilesCount,CurrentFileName,FilesCountPercent,RequestSize,TotalProgress, TotalProgressBar,TotalProgressPercent">
</telerik:RadProgressArea>
On aspx.cs
protected void buttonSubmit_Click(object sender, System.EventArgs e)
{
Radupload1.TargetFolder = @"Temp";
if (Radupload1.UploadedFiles.Count > 0)
{
const int total = 100;
RadProgressContext progress = RadProgressContext.Current;
progress.SecondaryTotal = total;
for (int i = 0; i < total; i++)
{
progress.SecondaryValue = i;
progress.SecondaryPercent = i;
progress.CurrentOperationText = "Step " + i.ToString();
if (!Response.IsClientConnected)
{
break; //Cancel button was clicked or the browser was closed, so stop processing
}
System.Threading.Thread.Sleep(100); //Stall the current thread for 0.1 seconds
}
}
}
Thanks
Vandana
Issue : When i am trying to upload small file. The progress bar initially showed activity but did not update the percentage and then suddenly the entire file was uploaded and showing 100%. Can't we show the progress correctly. For the case of large file - it is showing progress till last 5 seconds left, then it stuck for 5 second and file got uploaded. I dont want to show 2 progress bars actually i want to show only 1 progress bar with smooth transition.
Can you please help me out to solve this issue.
Below are the code lines i wrote in my page.
(In *.aspx)
<telerik:RadUpload ID="Radupload1" runat="server" InitialFileInputsCount="1" TargetFolder="~Temp"
TargetPhysicalFolder="C:\Temp" ControlObjectsVisibility="None" />
<asp:Button ID="buttonSubmit" runat="server" Text="Upload" OnClientClick="SetFileFromUpload(); StopSessionTimers();return ValidateCheck()"
OnClick="buttonSubmit_Click" CssClass="btn" />
<telerik:RadProgressManager ID="Radprogressmanager1" runat="server" />
<telerik:RadProgressArea ID="RadProgressArea1" runat="server" Localization-EstimatedTime="Estimated time"
Localization-TransferSpeed="Speed" DisplayCancelButton="false" Width="375px" OnClientSubmitting="submit" OnClientProgressUpdating="RadProgressArea1_OnClientProgressUpdating" ProgressIndicators="TransferSpeed,TimeEstimated,TimeElapsed,FilesCountBar,FilesCount,CurrentFileName,FilesCountPercent,RequestSize,TotalProgress, TotalProgressBar,TotalProgressPercent">
</telerik:RadProgressArea>
On aspx.cs
protected void buttonSubmit_Click(object sender, System.EventArgs e)
{
Radupload1.TargetFolder = @"Temp";
if (Radupload1.UploadedFiles.Count > 0)
{
const int total = 100;
RadProgressContext progress = RadProgressContext.Current;
progress.SecondaryTotal = total;
for (int i = 0; i < total; i++)
{
progress.SecondaryValue = i;
progress.SecondaryPercent = i;
progress.CurrentOperationText = "Step " + i.ToString();
if (!Response.IsClientConnected)
{
break; //Cancel button was clicked or the browser was closed, so stop processing
}
System.Threading.Thread.Sleep(100); //Stall the current thread for 0.1 seconds
}
}
}
Thanks
Vandana