RadAsyncUpload zip file extension, with maxfilesize

2 posts, 0 answers
  1. Joel
    Joel avatar
    174 posts
    Member since:
    Oct 2006

    Posted 08 Oct 2015 Link to this post

    I get a failure from OnClientFileUploadFailed when I allow zip files, and MaxFileSize is set.  If I remove MaxFileSize zip files upload correctly, but I would like to have both.  Is there a workaround for this?


    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="mu.aspx.cs" Inherits="CODAUploads.mu" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <!DOCTYPE html>
    <head runat="server">
         <meta charset="utf-8" />
          <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title><%: Page.Title %></title>
            <link rel="stylesheet" href="~/content/bootstrap.css"/>   
        <form id="form1" runat="server">
            <telerik:RadScriptManager runat="server" ID="rsm"></telerik:RadScriptManager>
    <asp:Panel ID="pnlUpload" runat="server">
        <telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" OnClientFileUploaded="OnClientFileUploaded" OnClientFileUploadFailed="badfiletype" OnClientValidationFailed="badfiletype"
            AllowedFileExtensions="zip,xlsx,xls,pdf,doc,docx" MaxFileSize="2048576" OnFileUploaded="AsyncUpload1_FileUploaded" Skin="Bootstrap" UploadedFilesRendering="BelowFileInput">
         <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                var uploadedFilesCount = 0;
                var isEditMode;
                function validateRadUpload(source, e) {
                    if (isEditMode == null || isEditMode == undefined) {
                        e.IsValid = false;
                        if (uploadedFilesCount > 0) {
                            e.IsValid = true;
                    isEditMode = null;
                function badfiletype(sender, eventArgs) {
                    alert("This file type is not accepted");
                function OnClientFileUploaded(sender, eventArgs) {
                             <span class="allowed-attachments">Select files to upload (<%= String.Join( ",", AsyncUpload1.AllowedFileExtensions ) %>)
                           <label>Attached files:</label>
                            <asp:Repeater runat="server" ID="AttachmentRepeater" EnableViewState="false">
                                    <span class="attachment icon-<%#Eval("FileExtension")%>">
                                        <%# Eval("FileName") %>
                                    (<%# Eval("ContentLength") %>kb);
    Code below

  2. Joel
    Joel avatar
    174 posts
    Member since:
    Oct 2006

    Posted 08 Oct 2015 in reply to Joel Link to this post

    Never mind.  Please remove this thread.  I thought MaxFileSize was in KB.  The zip file was 3mb.
Back to Top