Hi there.
I used the the FAQ-article to check the file-size of an uploaded File on client-side.
The Code Snippet looks like this:
When calling the the JS-Method by OnClientProgessUpdating-Event in RadProgressArea (like suggested in the FAQ-Article) args.progressData is undefined. When calling the Method from RadProgressManager args.progressData is defined and the messagebox is shown when the file is to big. Sadly, progressArea.cancelRequest does not to work because progressArea is undefinded (in both cases: calling from RadProgressManager as well as call from RadProgressArea)
Any clue what causes this problem?
I used the the FAQ-article to check the file-size of an uploaded File on client-side.
The Code Snippet looks like this:
| <telerik:RadCodeBlock ID="RadCodeBlock12" runat="server"> |
| <script language="javascript" type="text/javascript"> |
| function CheckUploadedFilesSize(progressArea, args) { |
| try { |
| alert(progressArea.Confirmed); // undef |
| alert(args.ProgressData); // undef |
| if (!progressArea.Confirmed && args.ProgressData.RadUpload.RequestSize > 100000000) { |
| alert('<asp:Literal runat="server" Text="<%$Resources:TextResources, ERROR_FILE_TO_BIG%>" />'); |
| // document.close(); |
| progressArea.cancelRequest(); |
| } |
| } catch (e) { |
| // Ignore... |
| } |
| } |
| </script> |
| </telerik:RadCodeBlock> |
| [...] <form ...> <RadFormDecorator... /> <RadScriptManager... /> <RadAjaxManager ... /> <RadAjaxPanel...> [...] |
| <telerik:RadUpload ID="radUpload1" runat="server" ControlObjectsVisibility="ClearButtons" |
| Culture="German" |
| Language="de-DE" OverwriteExistingFiles="true" SkinID="Uploader" Width="100%" Height="100%" MaxFileInputsCount="5" InitialFileInputsCount="3" MaxFileSize="1048576" > |
| <Localization Add="<%$Resources:TextResources, UPLOADER_ADD%>" |
| Clear="<%$Resources:TextResources, UPLOADER_CLEAR%>" |
| Select="<%$Resources:TextResources, UPLOADER_SELECT%>" /> |
| </telerik:RadUpload> |
| <telerik:RadProgressArea Visible="true" runat="server" id="RadProgressArea1" /> |
| <telerik:RadProgressManager ID="Radprogressmanager1" runat="server" OnClientProgressUpdating="CheckUploadedFilesSize"/> [...] </RadAjaxPanel></form> |
Any clue what causes this problem?