+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / File Types for Files Area

File Types for Files Area

6 posts, 0 answered
  1. Phil Wilson
    Phil Wilson avatar
    18 posts
    Registered:
    22 Apr 2010
    27 Jul 2011
    Link to this post
    We are attempting to expand the list of acceptable file types in the Files area of Sitefinity 3.7. This isn't the Images & Documents Libraries but rather the Files area itself on the same tier as Modules, Pages, Administration, etc.

    We found this file: /Sitefinity/Admin/Files.aspx which appeared to have the code block we were looking for (as detailed below) but that only seemed to affect the list of extensions shown in the upload control - not the actual file types allowed:

            <telerik:RadFileExplorer ID="RadFileExplorer1" runat="server" 
    DisplayUpFolderItem="True" 
    Width="100%" Height="1000px"
                OnClientItemSelected="OnClientItemSelected"            
    Skin="WebBlue" 
    VisibleControls="TreeView, Grid, Toolbar, ContextMenus"
    MaxUploadFileSize = "10485760" onitemcommand="RadFileExplorer1_ItemCommand" >
                <Configuration ViewPaths="/Files/,/Images/," UploadPaths="/files/,/images/" DeletePaths="/files/,/images/" 
                    MaxUploadFileSize="78643200" 
                    SearchPatterns="*.jpg,*.png,*.gif,*.pdf, *.ppt*, *.doc*, *.xls*,*.flv,*.swf,*.mov,*.wmv,*.mp4"  />
            </telerik:RadFileExplorer>


    When uploading a PPT file, we still get an error stating: "The extension of the uploaded file is not valid. Please, provide a valid file!"


    So, can anyone provide guideance as to how we can go about allowing different file types for the upload control for the Files area?

    Thanks!
  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    06 Dec 2016
    27 Jul 2011
    Link to this post
    Hello Phil Wilson,

    Please take look at this forum thread which contains a detailed explanation and code sample on how to set the desired functionality in libraryinfo/Document.If there's anything else we can help you with, please let us know.

    Kind regards,
    Boyan Barnev
    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. Phil Wilson
    Phil Wilson avatar
    18 posts
    Registered:
    22 Apr 2010
    19 Aug 2011
    Link to this post
    Thanks.

    I think there's a little confusion... I was asking about the file types for the Files area of Sitefinity 3.7 -not- using the Images & Documents module.

    So, basically, the problem we're having is trying to upload files by clicking Files and then clicking the Upload button.

    That's where we're getting the error.
  4. Phil Wilson
    Phil Wilson avatar
    18 posts
    Registered:
    22 Apr 2010
    23 Aug 2011
    Link to this post
    <bump>
  5. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    06 Dec 2016
    24 Aug 2011
    Link to this post
    Hello Phil Wilson,

    I'm sorry for not providing the relevant information. I have inspected the Files.ascx control, however it does not contain a declaration for RadFileExplorer, can you please send it to me so I can inspect it further? Generally file upload should be handled by the RadUpload control. However, on my local sitefinity 3.7 Project I was able to successfully upload a *.ppt file without doing any modifications to the defauklt template., please take a look at the attached video I have recorded for you while testing the functionality. Please also find below the default template we are using for the Files.ascx control:
    <%@ Page Language="C#" MasterPageFile="~/Sitefinity/Admin/Admin.master" AutoEventWireup="true" CodeFile="Files.aspx.cs" Inherits="Admin_Files" Title="Untitled Page" %>
     
    <%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %>
    <%@ Register Assembly="Telerik.FileManager" Namespace="Telerik.FileManager" TagPrefix="cc1" %>
    <%@ Register Assembly="Telerik.FileManager" Namespace="Telerik.FileManager.WebControls" TagPrefix="cc2" %>
    <%@ Register Assembly="Telerik.Cms.Web.UI" Namespace="Telerik.Cms.Web.UI" TagPrefix="sfWeb" %>
     
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        <div id="main">
            <div class="in">
                <div runat="server" id="mainPanel">
                    <cc1:ManageFiles Visible="true" runat="server" ID="fileManager">
                        <FilesUploaderTemplate>
                        <div class="ToolsAll">
                            <sfWeb:MessageControl runat="server" ID="message">
                                <ItemTemplate>
                                    <asp:Literal runat="server" ID="messageText"></asp:Literal>
                                </ItemTemplate>
                            </sfWeb:MessageControl>
                            <div class="backWrapp">
                                <asp:LinkButton ID="cancelUploadButton" runat="server" CssClass="actions back"><asp:Literal runat="server" Text="<%$Resources:CancelAndGoBack %>"></asp:Literal></asp:LinkButton>
                            </div>
                        </div>
                        <div class="workArea insert">
                            <div class="mainForm">
                            <h3 class="uplHead"><asp:Literal runat="server" Text="<%$Resources:SelectFilesToUpload %>"></asp:Literal></h3>
                            <div class="set">
                                <div class="setIn">
                                <telerik:RadUpload
                                ID="uploader"
                                InitialFileInputsCount="10"
                                runat="server"
                                ControlObjectsVisibility="AddButton"
                                Width="400"
                                EnableEmbeddedSkins="false"
                                Skin="Sitefinity"
                                />
                                <!--<asp:Repeater ID="uploadedHistory" runat="server">
                                <ItemTemplate>
                                    <asp:Repeater ID="filesList" runat="server">
                                        <ItemTemplate>
                                            <asp:Literal ID="fileName" runat="server"></asp:Literal>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </ItemTemplate>
                            </asp:Repeater>-->
                                </div>
                            </div>
                            <div class="bottom"><div><!-- --></div></div>
                            <p class="button_area">
                                <asp:LinkButton ID="uploadButton" runat="server" CssClass="CmsButLeft upldark"><strong class="CmsButRight dark"><asp:Literal runat="server" Text="<%$Resources:Upload %>"></asp:Literal></strong></asp:LinkButton>
                                <span><asp:Literal runat="server" Text="<%$Resources:Or %>"></asp:Literal></span>
                                <asp:LinkButton ID="cancelUploadButton1" runat="server" cssClass="cmscclcmd" Text="<%$Resources:Cancel %>"></asp:LinkButton>
                            </p>
                            
                            </div>
                        <div class="info" id="divFaq" runat="server">
                            <div class="infoBottom">
                                <h3><asp:Literal runat="server" Text="<%$Resources:HowToUpload %>"></asp:Literal></h3>
                                <asp:Literal runat="server" Text="<%$Resources:HowToUploadText %>"></asp:Literal>
                                <p class="hideAllFAQs">
                                    <a runat="server" id="lnkHideFaq" href="javascript:void(0)">Hide FAQs everywhere</a>
                                </p>
                                <!--<h3>Where to upload?</h3>
                                <dl class="faq">
                                    <dt>Masterpages</dt>
                                    <dd>In the <em>App_master</em> folder and use them as templates.</dd>
                                    <dt>Css files</dt>
                                    <dd>If you are using Css files as Themеs, upload them in the <a class="HelpBox"></a> <em>App_Themes</em> folder. If they are linked to a given page, upload them wherever you like but be careful when setting the path in the link to them.</dd>
                                    <dt>Images, video, flash</dt>
                                    <dd>In the Images folder or anywhere else you find appropriate. Careful with paths.</dd>
                                </dl>-->
                            </div>
                        </div>
                    <div class="clear"><!-- --></div>
                    </div>
                        </FilesUploaderTemplate>
                        <FilesGridTemplate>
                        <div class="workArea temp">
                            <div class="mainForm">                 
                            <telerik:RadGrid ID="fileGrid"
                                          runat="server"
                                          BorderWidth="0"
                                          MasterTableView-GridLines="None"
                                          AllowSorting="true"
                                          AllowPaging="true"
                                          PageSize="20"
                                          PagerStyle-Mode="NextPrevAndNumeric"
                                          CellPadding="3"
                                          MasterTableView-EditMode="InPlace"
                                          AllowMultiRowSelection="true"
                                          AllowMultiRowEdit="false"
                                          EnableEmbeddedSkins="false"
                                          Skin="Sitefinity"
                                          >
                              <ClientSettings Resizing-AllowColumnResize="true"
                                              Resizing-AllowRowResize="false"
                                              AllowColumnsReorder="false"
                                              Selecting-AllowRowSelect="true"
                                              ClientEvents-OnRowContextMenu="OnFilesListContextClick"
                                              ClientEvents-OnRowCreated="OnFilesListRowCreated"
                                              Selecting-EnableDragToSelectRows="false"
                                             >
                              </ClientSettings>
                              <MasterTableView AutoGenerateColumns="false">
                                <Columns>
                                    <telerik:GridBoundColumn DataField="Extension"
                                                          UniqueName="Icon"
                                                          HeaderStyle-Width="30"
                                                          HeaderStyle-HorizontalAlign="center"
                                                          ReadOnly="true"></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Name"
                                                          UniqueName="Name"
                                                          HeaderText="<%$Resources:Name %>"></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Size"
                                                          UniqueName="Size"
                                                          HeaderText="<%$Resources:Size %>"
                                                          HeaderStyle-Width="60"
                                                          ItemStyle-HorizontalAlign="Right"
                                                          ReadOnly="true"></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Extension"
                                                          UniqueName="Extension"
                                                          HeaderText="<%$Resources:Extension %>"
                                                          HeaderStyle-Width="60"
                                                          HeaderStyle-HorizontalAlign="right"
                                                          ItemStyle-HorizontalAlign="right"
                                                          ReadOnly="true"></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="DateModified"
                                                          UniqueName="DateModified"
                                                          HeaderText="<%$Resources:DateModified %>"
                                                          DataFormatString="<%$Resources:DateModifiedFormat %>"
                                                          HeaderStyle-Width="130"
                                                          HeaderStyle-HorizontalAlign="left"
                                                          ReadOnly="true"></telerik:GridBoundColumn>
                                </Columns>
                              </MasterTableView>
                              <PagerStyle Mode="NumericPages" />
                            </telerik:RadGrid>
                            <telerik:RadContextMenu ID="gridContextMenu"
                                          runat="server"
                                          EnableEmbeddedSkins="false"
                                          Skin="Sitefinity"
                                          >
                                          <Targets>
                                          <telerik:ContextMenuElementTarget ElementID="gridElementTarget" />
                                          </Targets>
                            </telerik:RadContextMenu>
                            </div>
                            <div class="info" id="divFaq" runat="server">
                                <div class="infoBottom">
                                    <h3><asp:Literal runat="server" Text="<%$Resources:FilesFAQ %>"></asp:Literal></h3>
                                    <asp:Literal runat="server" Text="<%$Resources:FilesFAQText %>"></asp:Literal>
                                    <p class="hideAllFAQs">
                                        <a runat="server" id="lnkHideFaq" href="javascript:void(0)">Hide FAQs everywhere</a>
                                    </p>
                                </div>
                            </div>
                            <div class="clear"><!-- --></div>
                            </div>
                        </FilesGridTemplate>
                    </cc1:ManageFiles>
                </div>
                </div>
            </div>
        <div id="subnav">
            <div class="in">
            <h2><asp:Literal runat="server" Text="<%$Resources:SelectAFolder %>"></asp:Literal></h2>
            <div class="folderTreeViewPlh">
                <cc2:FoldersNavigation id="foldersNavigation" runat="server">
                    <FoldersNavigationTemplate>
                        <telerik:RadTreeView ID="foldersTree"
                                          runat="server"
                                          AutoPostBack="true"                 
                                          EnableDragAndDrop="true"
                                          AllowNodeEditing="true"
                                          SingleExpandPath="true"
                                          EnableDragAndDropBetweenNodes="true"
                                          EnableEmbeddedSkins="false"
                                          Skin="SitefinityFiles"                                     
                                          >
                        </telerik:RadTreeView>
                        <telerik:RadContextMenu ID="foldersContextMenu"
                                          runat="server"
                                          EnableEmbeddedSkins="false"
                                          Skin="Sitefinity" >
                                          <Targets>
                                          <telerik:ContextMenuElementTarget ElementID="foldersElementTarget" />
                                          </Targets>
                            </telerik:RadContextMenu>
                    </FoldersNavigationTemplate>
                </cc2:FoldersNavigation>
            </div>
            </div>
        </div>
        <div class="clear width"><!-- --></div>
    </asp:Content>

    Can you please right click on any frontend page from the project, and view the pageinfo, and let me know what is the value for the Generator field? Looking forwards to your reply.

    All the best,
    Boyan Barnev
    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 >>

  6. Hydo L
    Hydo L avatar
    98 posts
    Registered:
    31 Mar 2010
    06 Oct 2011
    Link to this post
    Hi,

    I am facing the same issue as Phil Wilson. When I tried to upload an flv file (size 64MB) I am getting timed out (see attached screen shot). My sitefinity version is Sitefinity 3.7.2022.2:1.

    On webconfig setting is as follows
    <httpRuntime maxRequestLength="2048000" executionTimeout="3600"/>

    Can anyone help me on this.

    Regards,
    Hydo
Register for webinar
6 posts, 0 answered