This is a migrated thread and some comments may be shown as answers.

Document Manager - uploading *.mht files

2 Answers 87 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Bader
Top achievements
Rank 1
Bader asked on 28 Dec 2011, 02:59 PM
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 Answers, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 1
answered on 28 Dec 2011, 08:50 PM

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!

0
Rumen
Telerik team
answered on 29 Dec 2011, 04:25 PM
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
Tags
Editor
Asked by
Bader
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or