More in this section

Forums / General Discussions / Uploading Flash Files Larger Then 200kb

Uploading Flash Files Larger Then 200kb

17 posts, 0 answered
  1. Ismet
    Ismet avatar
    2 posts
    Registered:
    12 Jan 2008
    04 May 2011
    Link to this post
    I have a client that has Sitefinity 3 and Sitefinitiy 4 websites. He told me to fix some of the issues he has been experiencing recently. Well, so far i was able to fix some of them.

    Although i have more knowledge about DNN cms i know Sitefinity also uses Rad Controls. So i thought it would be easier task to overcome 200kb flash file size limitation.

    Before opening this post, i tried to check Sitefinity 4's files and found nowhere to increase this limit. I used to increase file upload size for DNN from web.config, so i thought using this method would help since ASP.NET applications rely on upload size limitations from web.config entries generally.

    Anyway, this didn't work and a post directed me to ExternalTemplates.zip file which i couldn't access to download link from my own client account and my customer's account. So i assume logic has been changed with recent versions of Sitefinity.

    I would like to ask and learn how one can change the upload size limitation for Flash files?

    Warm regards.
  2. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    04 May 2011
    Link to this post
    Hi Ismet,

    The setting cannot be modified. If you want to upload files larger than 200kb you can put them directly using VS.  You can also use FTP to upload your flash files to a particular folder of your choosing. You will have no troubles using this method when having .swf files which exceed the limitation of 200k.

    You can also check the following article which can give you another set of ideas concerning the file upload control.

    All the best,
    Victor Velev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Michael Diolosa
    Michael Diolosa avatar
    11 posts
    Registered:
    29 Jul 2009
    04 May 2011
    Link to this post
    I'm very confused as to why you would restrict a file upload to 200KB.  This is quite destructive to the standard CMS user who may not have knowledge of FTP. The fact that FTP is the option given is also alarming as it is a completely insecure means of connecting to a server.

    My issue with not allowing users to upload files larger than 200KB lies in the inability for Sitefinity to server HTML 5 video to iOS devices as stated in one of my prior forum posts. Since the Library manager is incapable of serving video to iOS devices the only means for CMS users to upload videos is through the file manager of Sitefinity.

    While it's easy to say, "You must FTP or use Visual Studio to upload the videos," to a developer, how do you relay this fact to clients who are expecting a full featured CMS built into a single package.

    I'm quite baffled that the file uploader does not use the maximum file size configured within the web.config file.
  4. Ismet
    Ismet avatar
    2 posts
    Registered:
    12 Jan 2008
    04 May 2011
    Link to this post
    I use also DotNetNuke for my own webs and my clients' webs. However DNN does not have such hardcoded limitation with uploading large swf files. At least you can modify web.config to enhance this limit.

    It is interesting to see your reply about using FTP or Visual Studio. Me, myself as a developer it shouldn't be a problem to use FTP or VS to upload this file. However, manually putting this file into Files directory didn't enable access to it.  Instead i still saw empty tree under Flash Manager. End users will also have trouble while editing content.

    For instance, as an administrator i wouldn't giveaway FTP access to designers in my team with a powerful cms. Also loading VS to designers' computers is not an option because of multiple reasons.

    Sorry for comparing with DNN, but if one opt to upload a file to DNN's file system via FTP, there is a sync button on File Manager page of DNN's Admin section. But i couldn't find such option for Sitefinity.

    Maybe you should reconsider this 200kb limitation on upload.

  5. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    05 May 2011
    Link to this post
    Hi,

    Because the limitation is hardcoded you need create custom upload manager and override the one that we have in the backend. Please check the following article which can give you another set of ideas concerning the file upload control. I have logged it in PITS so you can keep track of the issue and vote for it. 

    Regards,
    Victor Velev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Michael Diolosa
    Michael Diolosa avatar
    11 posts
    Registered:
    29 Jul 2009
    05 May 2011
    Link to this post
    Yep, unfortunately my client's network team does not give FTP access to CMS administrators so I've already built a custom file uploader that uses the ASP.NET configured file size limits.
  7. FlR
    FlR avatar
    49 posts
    Registered:
    05 Oct 2010
    04 Jul 2011
    Link to this post
    I have the same issue and I want to ask you if this is for real - I mean there is no way, other than creating a custom control, ti change the upload limit size.

    There may be reasons behind this strategy but really to harcode this?!

    Except creating a custom control is there no other way increasing the limit?
  8. Sam
    Sam avatar
    1 posts
    Registered:
    04 Jul 2011
    05 Jul 2011
    Link to this post
    Can there be an enhancement made to the system to allow files over 200kb?
  9. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    05 Jul 2011
    Link to this post
    Hi Sam,

    The 200kb file limit can be changed to a value of your wish. You can do that from Settings -> Advanced -> System -> FilesModule -> MaxFileSize ( you can check the attached screenshot for the exact location of that setting ). Please note that the value is in bytes and the setting is available in build 1501 ( Sitefinity 4.1 SP2 ).

    Kind regards,
    Victor Velev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  10. shae
    shae avatar
    30 posts
    Registered:
    26 Jul 2012
    11 Jul 2011
    Link to this post
    I'm running the latest version and changing this number DID NOT affect anything.

    I'm still getting an upload error.
  11. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    12 Jul 2011
    Link to this post
    Hello Shae,

    Please check the video I have created for you using blank project hosted using the VS. Make sure you do not have any server restrictions which are preventing you from changing the limit.

    Kind regards,
    Victor Velev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  12. shae
    shae avatar
    30 posts
    Registered:
    26 Jul 2012
    12 Jul 2011
    Link to this post
    Yes, you are right, It works in the System Files, but it does not work in the Flash manager. Which is what I believe this thread was started for.

    you can view the video here
  13. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    13 Jul 2011
    Link to this post
    Hi Shae,

    You can map template for HtmlField and specify "MaxUploadFileSize" value which will set the default restriction for the Flash Manager in our content editor. To map the template, please follow the below steps:

     1. Create a custom template based on the below sample (name is not important in this case, as long as
    you specify the correct application relative path when mapping the template):

    <%@ Control Language="C#" CodeFile="~/Controls/EditorTemplate.ascx.cs" Inherits="SitefinityWebApp.Controls.EditorTemplate"%>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
             
    <sf:ConditionalTemplateContainer ID="conditionalTemplate" runat="server">
        <Templates>
            <sf:ConditionalTemplate ID="ConditionalTemplate1" Left="DisplayMode" Operator="Equal" Right="Read" runat="server">
                <sf:SitefinityLabel id="titleLabel_read" runat="server" WrapperTagName="div" HideIfNoText="false" CssClass="sfTxtLbl" />
                <sf:SitefinityLabel id="viewControl" runat="server" WrapperTagName="div" HideIfNoText="false" CssClass="sfRTFContent" />
            </sf:ConditionalTemplate>
            <sf:ConditionalTemplate ID="ConditionalTemplate2" Left="DisplayMode" Operator="Equal" Right="Write" runat="server">
                <sf:ResourceLinks id="resourcesLinks2" runat="server">
                    <sf:EmbeddedResourcePropertySetter Name="Telerik.Sitefinity.Resources.Themes.Default.Styles.EditorDialogs.css" Static="true" ControlID="editControl" ControlPropertyName="DialogsCssFile" />
                    <sf:ResourceFile Name="Telerik.Sitefinity.Resources.Themes.Default.Styles.Window.css" Static="true" />
                </sf:ResourceLinks>
                <asp:Label ID="titleLabel_write" runat="server" CssClass="sfTxtLbl" AssociatedControlID="editControl" />
                <asp:LinkButton ID="expandLink" runat="server" OnClientClick="return false;" CssClass="sfOptionalExpander" />
                <asp:Panel ID="expandableTarget" runat="server" CssClass="sfEditorWrp sfClearfix">
                    <telerik:RadEditor
                        ID="editControl"
                        runat="server"
                        Skin="Sitefinity"
                        Width="100%"
                        Height="550px"
                        EnableResize="False"
                        EditModes="Design,HTML"
                        DialogHandlerUrl="~/Telerik.Web.UI.DialogHandler.axd"
                        Content=""
                        NewLineBr="False"
                        StripFormattingOptions="Css,Font,Span"
                        OnClientLoad="Telerik$Sitefinity$Web$UI$Fields$HtmlField$radEditorToggleAdvancedToolbars"
                        OnClientPasteHtml="OnClientPasteHtml"
                        OnClientCommandExecuting="OnClientCommandExecuting">
                        <FlashManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" MaxUploadFileSize="1208000" />
                    </telerik:RadEditor>
                    <sf:SitefinityLabel id="descriptionLabel" runat="server" WrapperTagName="div" HideIfNoText="true" CssClass="sfDescription" />
                    <sf:SitefinityLabel id="exampleLabel" runat="server" WrapperTagName="div" HideIfNoText="true" CssClass="sfExample" />
                </asp:Panel>        
              
                <script type="text/javascript">
                    /* <![CDATA[ */
                             
                    var className = null;
                    var toRemove = false;
                    var handlersAdded = false;
             
                    function OnClientPasteHtml(sender, args)
                    {
                        var newContent = args.get_value();
                        newContent = newContent.replace(new RegExp("<b(\\s([^>])*?)?>", "ig"), "<strong$1>");
                        newContent = newContent.replace(new RegExp("</b(\\s([^>])*?)?>", "ig"), "</strong$1>");
                        newContent = newContent.replace(new RegExp("<i(\\s([^>])*?)?>", "ig"), "<em$1>");
                        newContent = newContent.replace(new RegExp("</i(\\s([^>])*?)?>", "ig"), "</em$1>");
                        var regex = /<([a-zA-Z]+) ?[^>]*?>\s*<\/\1>/gi;
                        newContent = newContent.replace(regex, "");
                                 
                        args.set_value(newContent);
                    }
             
                    function OnClientCommandExecuting(editor, args) {
                             
                        var name = args.get_name();
                        var val = args.get_value();
                                 
                        var commandName = args.get_commandName();
                        className = "re" + commandName;
                        if (editor.get_dialogOpener())
                        {
                            if (editor.get_dialogOpener()._container && !handlersAdded)
                            {
                                editor.get_dialogOpener()._container.add_show(AddRemoveCSSClass);
                                editor.get_dialogOpener()._container.add_close(AddRemoveCSSClass);
                                handlersAdded = true;
                            }
                        }
             
                        if (name == "MergeTags")
                        {
                            editor.pasteHtml(val);
                            //Cancel the further execution of the command as such a command does not exist in the editor command list
                            args.set_cancel(true);
                        }
             
                        if (commandName == "ToggleScreenMode") {
                            var containerWnd = GetRadWindow();
                            if (!editor.isFullScreen()) //if the editor is placed in fullscreen mode specify the needed content area width
                            {
                                $(editor.get_element()).addClass("sfFullScreenEditor");
                                if(containerWnd != null && !containerWnd.isMaximized())
                                {
                                    containerWnd.maximize();
                                    $(containerWnd.get_element()).addClass("sfWndToBeRestored");
                                }
                                editor.get_document().body.style.maxWidth = "640px";
                            }
                            else 
                            {
                                $(editor.get_element()).removeClass("sfFullScreenEditor");
                                if(containerWnd != null && $(containerWnd.get_element()).hasClass("sfWndToBeRestored"))
                                {
                                    $(containerWnd.get_element()).removeClass("sfWndToBeRestored");
                                    containerWnd.restore();
                                }
                                editor.get_document().body.style.maxWidth = "100%";
                            }
                        }
             
                    }
             
                    function AddRemoveCSSClass(sender, args)
                    {
                        var popupElement = sender.get_popupElement();
                        if (!toRemove)
                        {
                            Sys.UI.DomElement.addCssClass(popupElement, className);
                        }
                        else
                        {
                            Sys.UI.DomElement.removeCssClass(popupElement, className);
                        }
                    }
             
                    function GetRadWindow()
                    {
                        var oWindow = null;
                        if (window.radWindow) oWindow = window.radWindow;
                        else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
                        return oWindow;
                    }
             
                    /* ]]> */
                </script
            </sf:ConditionalTemplate>
        </Templates>        
    </sf:ConditionalTemplateContainer>

    2. Next step is to create a codefile (in my case EditorTemplate.ascx.cs) where you point the Editor control to the location of your custom ToolsFile:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
             
    namespace SitefinityWebApp.Controls
    {
        public partial class EditorTemplate : System.Web.UI.UserControl
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                editControl.PreRender += new EventHandler(editControl_PreRender);
            }
             
            void editControl_PreRender(object sender, EventArgs e)
            {
                editControl.ToolsFile = "~/Controls/EditorTools.xml";              // specify the app relative path to your custom ToolsFile
            }
        }
    }

    3. Please find the default ToolsFile we're using for the Editor, you can add your custom buttons to it according to this article from our RadEditor documentation. In the same section you can find guidance on adding custom dialogs as well
    <?xml version="1.0" encoding="utf-8" ?>
    <root>
        <modules>
            <module name="RadEditorStatistics" dockingZone="Bottom" visible="false" />
            <module name="RadEditorDomInspector" visible="false" />
            <module name="RadEditorNodeInspector" visible="false" />
            <module name="RadEditorHtmlInspector" visible="false" />
        </modules>
        <tools name="MainToolbar">
        <tool name="ToggleAdvancedToolbars"/>
        <tool name="Bold" shortcut="CTRL+B"/>
        <tool name="Italic" shortcut="CTRL+I"/>
        <tool name="ApplyClass" />
        <tool separator="true"/>
        <tool name="InsertOrderedList" />
        <tool name="InsertUnorderedList" />
        <tool separator="true"/>
        <tool name="LinkManager" shortcut="CTRL+K"/>
        <tool name="Unlink" shortcut="CTRL+SHIFT+K"/>
        <tool name="ImageManager" shortcut="CTRL+G"/>
        <tool separator="true"/>
        <tool name="AjaxSpellCheck"/>
        <tool separator="true"/>
        <tool name="PasteFromWord" />
        </tools>
        <tools>
        <tool separator="true"/>
        <tool name="JustifyLeft" />
        <tool name="JustifyRight" />
        <tool name="JustifyCenter" />
        <tool name="JustifyFull" />
        <tool separator="true"/>
        <tool name="Indent" />
        <tool name="Outdent" />
      </tools>
      <tools>
        <tool name="FontName" shortcut="CTRL+SHIFT+F"/>
        <tool separator="true"/>
        <tool name="RealFontSize"/>
        <tool separator="true"/>
        <tool name="FormatBlock"/>
        <tool separator="true"/>
        <tool name="ForeColor"/>
        <tool name="BackColor"/>
        <tool separator="true"/>
        <tool name="MediaManager" />
        <tool name="FlashManager" />
        <tool name="DocumentManager" />
      </tools>
      <tools>
        <tool name="InsertParagraph" />
        <tool name="InsertTable" />
        <tool name="InsertSymbol"/>
        <tool name="InsertHorizontalRule" />
        <tool separator="true"/>
        <tool name="Superscript" />
        <tool name="Subscript" />
        <tool separator="true"/>
        <tool name="FormatStripper"/> 
        <tool separator="true"/>
        <tool name="FindAndReplace" shortcut="CTRL+F"/>
        <tool name="Print" shortcut="CTRL+P"/>
        <tool name="ToggleScreenMode" />
      </tools>
    </root>

    4. Once you have built the project, go to Sitefinity Backend -> Administration->Settings->Advanced->Controls->ViewMap and create and click on the Creae new button.

    Fill in the fields accordingly (all without the quotes):

    HostType: "Telerik.Sitefinity.Web.UI.Fields.HtmlField"
    LayoutTemplatePath:"relative path to the template where you have declared HtmlField control"
     Build the project, and restart the application, and you should have your custom template loaded globally throughout your website in all instances of the Content editor. 

    All the best,
    Victor Velev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  14. Larry Brindise
    Larry Brindise  avatar
    6 posts
    Registered:
    15 Jun 2010
    26 Aug 2011
    Link to this post
    It's really cool we can enhance the system like that, but should it be required we do this to simply change the upload size?  I just ran into this problem, and one of the whole purposes of us implementing a CMS was so non-technical users can upload objects of this type (e.g., flash) without high-level technical skills.
    Can you please put me on the list as voting for making this limitation a parameter somewhere?  You refer to PITS.  Is there a link to this issue so I can add a vote?
  15. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    31 Aug 2011
    Link to this post
    Hi Larry Brindise,

    Th thread you are looking not relevant at the moment because we exposed such property in the Settings -> Advanced -> System - FilesModule.

    Please note that the value is in bytes and the setting is available in build 1501 ( Sitefinity 4.1 SP2 ).

    Kind regards,
    Victor Velev
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  16. Eric
    Eric avatar
    2 posts
    Registered:
    07 Mar 2011
    17 Jan 2012
    Link to this post
    The procedure to override the maximum upload file size for .swf-files(200kb) in the WYSIWYG-editor is working fine, but to do it on all our existing sites is a real hassle. Since you have to implement the template, register it in the backend and re-compile. If you in later versions change something in the control template of the editor we have to do it all over again.

    I know that we're able to upload larger files via the Files Manager, but since it's not preferred to let the user get access to all the files in the project we want them to use the editor.

    Is there even a slight chance that you're going to change the maximum upload file size for .swf-files in the new release in February?
  17. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    18 Jan 2012
    Link to this post
    Hi Eric,

    We will try to push the feature as much as we can but it is hard to tell whether it will make it for upcoming 5.0 release. I have logged a feature request in PITS so you can vote and track the item.

    All the best,
    Victor Velev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
17 posts, 0 answered