Document Manager - uploading *.mht files

3 posts, 0 answers
  1. Bader
    Bader avatar
    215 posts
    Member since:
    Aug 2008

    Posted 28 Dec 2011 Link to this post

    Hi,

    I have aproblem in uploading *.mht files using the Document Manager of the RadEditor control. By selecting the required *.mht file and click Upload I get the "Internet Explorer cannot display the webpage" error.

    Here is my Code:
    string searchPatterns = "*.doc,*.txt,*.docx,*.xls,*.xlsx,*.pdf,*.xml,*.zip,*.rar,*.mht";
    CntntRadEditor.DocumentManager.SearchPatterns = searchPatterns.Split(',');

    By the way, I can upload all file types except to *.mht files, and there is no maximum upload size problem (File size is 4.5 MB and the MaxUploadFileSize is 30 MB).

    Can you please explain to me how can I upload such files using the Document Manager.

    Regards,
    Bader
  2. Richard
    Richard avatar
    479 posts
    Member since:
    Nov 2011

    Posted 28 Dec 2011 Link to this post

    Bader:

    I cannot reproduce your failure. I am able to upload an .mht file using the following code. See the attached image ("radeditor_documentmanager_upload.png") for the results.  I used your server-side code to set the search pattern.

    Default.aspx:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head runat="server">
        <title></title>
        <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
    </head>
    <body>
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //Put your JavaScript code here.
        </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <div>
        <telerik:RadEditor DocumentManager-ViewPaths="~/Uploads" DocumentManager-UploadPaths="~/Uploads" ID="RadEditor1" runat="server" DocumentManager-MaxUploadFileSize="2048000"></telerik:RadEditor>
        </div>
        </form>
    </body>
    </html>

    Default.aspx.cs:

    using System;
    using Telerik.Web.UI;
     
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string searchPatterns = "*.doc,*.txt,*.docx,*.xls,*.xlsx,*.pdf,*.xml,*.zip,*.rar,*.mht";
     
            RadEditor1.DocumentManager.SearchPatterns = searchPatterns.Split(',');
        }
    }

    The selected upload is "Toolbars.mht" and it is 1.27 mb.

    Have you tried uploading smaller .mht files to see if this relates to an upload timeout issue? Are you able to successfully upload other file types such as .zip or .rar files that are 4.5mb in size?

    Cheers!

  3. Rumen
    Admin
    Rumen avatar
    14432 posts

    Posted 29 Dec 2011 Link to this post

    Hi guys,

    If the uploaded file size exceeds the default ASP.NET limit of 4 MB then the framework will throw error and you will experience the reported problem. The solution is provided in the following help article: Uploading Large Files Using Editor (maxRequestLength).

    Best regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top