
...
RadUploadContext.GetProgressData()
The error is intermittent and occur before progressbar is visible.
It's a customer’s production server that I have no access to, so I have no server logs available etc. It look likes the response time is slow. Compare with other installations the time between I submit a file and to the progress is displayed is longer.
Is it possible that UploadedFile property ContentLength return 0?
if (RadUpload.UploadedFiles.Count > 0)
{
uploadedFile = RadUpload.UploadedFiles[0];
totalSize = uploadedFile.ContentLength;
}
do
{
bytesRead = reader.Read(buffer, 0, readChunkSize);
ms.Write(buffer, 0, bytesRead);
processedSize += bytesRead;
percent = (int)((processedSize / totalSize) * 100);
progress["SecondaryTotal"] = total.ToString();
progress["SecondaryValue"] = percent.ToString();
progress["SecondaryPercent"] = percent.ToString();
progress["CurrentOperationText"] = fileReadingMsg;
} while (bytesRead != 0);
Any suggestions?
11 Answers, 1 is accepted
It is unlikely that an uploaded fie will arrive at the server with ContentLentgth of zero, at least we haven't heard of similar reports from other clients. Is the error breaking the progress functionality? If no, you can suppress it, however, I need the exact error in order to provide you with the needed script. Apart from this, indeed the time between pressing the submit button and when the area is actually shown, is determined by the time it takes for the request to the progress area handler to return response. I am wondering whether you are not facing a timeout issue. Can you please paste a the detailed error here? A screenshot will also be of help.
Kind regards,
Genady Sergeev
the Telerik team

Thanks!
Because the error arise so rarely I have not had opportunity to catch a error message.. yet.. But one error report send to me (by Skype) is here:
RadUpload Ajax callback error. Source url returned invalid content: System.DivideByZeroException: Det gjordes ett försök att dividera med noll. vid System.Decimal.FCallDivide(Decimal& d1, Decimal& d2) vid Telerik.Web.UI.RadUploadContext.PopulateProgressData(RadUploadProgressData progressData) vid Telerik.W
Skype truncated the message….
The other time was by a webuser that did a print + scan + mail thing, so it looks terrible. But her it is…
And yes. The error breaks the upload and no progress is shown. Should I realy catch and ignore the error?
This is really strange problem. I suggest that you bullet proof your code against Division By Zero exception, for example you can check whether totalSize is bigger than zero. To be honest I can't think of a possible reason for file size being zero, perhaps it is a very rare issue that we haven't faced yet. In general I think that bullet proofing your code would do the job.
Regards,
Genady Sergeev
the Telerik team

I was thinking about increasing the time before a request would time out. Please take a look at this MSDN topic, which presents the httpRuntime element in web.config. You can use its executionTimeout property in order to set timeout timespan for a web request.
Kind regards,
Genady Sergeev
the Telerik team

I am also facing similar type of error, but could not get a resolution to the issue. Please let me know in case of any suggestions.I am attaching the screenshot here.

Check uploadeFile.ContentLengt is >0 before divide. But is it rely 0 no file is uploaded… Probably a timeout issue, so check web.config settings like something like:
<httpRuntime maxRequestLength="2000000" executionTimeout="600"/>

d:\context length zero.jpg
I've tried to reproduce the problem on our online demos, however, no avail. The FileDialong did correctly moan that such file does not exist. However, we might be missing something obvious. Could you please record a short video demonstrating how to reproduce the problem?
All the best,
Genady Sergeev
the Telerik team

It seems that you are using the classic controls, which are no longer supported and are likely to have issues, especially with the modern browsers. I suggest that you update to the ASP.NET Ajax controls as a resolution for the problem.
Greetings,
Genady Sergeev
the Telerik team