Hi mvjr,
The catch error function will check the file one by one, so it will not get all the large files at the same time. you can catch all upload file size when the user selec the files for upload, then check it by your own code, like below.
- <%@ Page Language="C#" %>
-
- <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %>
- <!DOCTYPE html>
-
-
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title></title>
- </head>
- <body>
- <form id="form1" runat="server">
- <CuteWebUI:UploadAttachments runat="server" ID="uploader1">
- </CuteWebUI:UploadAttachments>
- </form>
- </body>
- </html>
- <script type="text/javascript">
- function CuteWebUI_AjaxUploader_OnSelect(files) {
- var namelist = "";
- var sizelist = "";
- for (var i = 0; i < files.length; i++)
- {
- var size = files[i].FileSize / 1024;
-
- if (size > 10)
- {
- namelist+=files[i].FileName;
- namelist += ",";
- sizelist += size;
- sizelist += ",";
- }
-
- }
- if (namelist != "")
- {
- alert(namelist + "cannot be uploaded. File size(" + sizelist + ") is too large");
- return false;
- }
-
- }
- </script>
Regards,
Ken