More in this section

Forums / Developing with Sitefinity / File download in File Administration?

File download in File Administration?

12 posts, 0 answered
  1. Jules
    Jules avatar
    65 posts
    Registered:
    20 Jul 2005
    18 Jul 2008
    Link to this post
    Does anyone know if there is a way to tweak Sitefinity 3.1 to allow me to download files from the File Administration section of the CMS?

    Jules
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    21 Jul 2008
    Link to this post
    Hi Julia Essex,

    This feature was implemented in Sitefinity 3.2 SP2. You could consider upgrading to that version, because changing Sitefinity 3.1 for this feature is not possible.

    Greetings,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Andreas
    Andreas avatar
    49 posts
    Registered:
    29 Dec 2007
    27 Aug 2008
    Link to this post
    Uhm was this feature removed in Sitefinity 3.2 SP2 1616? Or did I install the wrong version?

    //Andreas
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    27 Aug 2008
    Link to this post
    Hello Andreas,

    Please take my apologizes, I had to mention the steps you should take in order to enable this feature.

    1. Please open the file Files.aspx, located in \[YourProject]\Sitefinity\Admin\
    2. In section <MasterTableView AutoGenerateColumns="false">, make sure your code look like this:

    <radG:GridHyperLinkColumn UniqueName="DownloadLink" Target="_blank" Text="Download"HeaderStyle-Width="20"HeaderStyle-HorizontalAlign="center"></radG:GridHyperLinkColumn> 
     
    <cc1:ManageFiles Visible="true" runat="server" ID="fileManager"
    showDownloadLink
    ="true"

    This is all. Let us know if you have any problems.

    Regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Tim
    Tim avatar
    10 posts
    Registered:
    09 Nov 2007
    09 Nov 2009
    Link to this post
    I am in sitefinty 3.6 and need the file download function enabled.  How do i do that ?
    thanks,
  6. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    09 Nov 2009
    Link to this post
    Hello Tim,

    The procedure is the same as in the previous post. Let me know if you get different result using the same approach.

    Greetings,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. Tim
    Tim avatar
    10 posts
    Registered:
    09 Nov 2007
    09 Nov 2009
    Link to this post

    Do I add the snippet inside or outside of the column tag or inside.

    Below is the section of the (it think) correct section of the files.aspx file.  Where do I add the snippet of code. 

    (I've tried a few spots with no success)

     

    thanks

    Tim

    <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>

  8. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    09 Nov 2009
    Link to this post
    Hi Tim,

    Apologies for the misleading information, I found that it is not clear the way I described it several posts below. Here is what you should do:

    1. Open the Files.aspx - the same file from which you pasted the html
    2. Add the ShowDownloadLink attribute to the cc1:ManageFiles control:
    <cc1:ManageFiles Visible="true" runat="server" ID="fileManager" ShowDownloadLink="true">

    3. Add the Grid column, which should hold the download link:

    <MasterTableView AutoGenerateColumns="false">
     <Columns>
     ..
    <telerik:GridHyperLinkColumn
                         UniqueName="DownloadLink"
                         Text="Download"
                         Target="_blank"
                         HeaderText="download"
                         HeaderStyle-Width="20"
                         HeaderStyle-HorizontalAlign="center"></telerik:GridHyperLinkColumn>
     </Columns>
    </MasterTableView>

    Attached is the changed file as well, for your convenience. 

    All the best,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  9. Tim
    Tim avatar
    10 posts
    Registered:
    09 Nov 2007
    09 Nov 2009
    Link to this post
    Thanks,
    Almost working.  I get the download option, but when I try to use it,  it says it cannot find the path:

    file:///E:/programfiles/telerik/sitefinity3.6/MySite/myFile.css    (the path looks correct)

    Should it be trying to get the whole path, or should it be relative to the website ?

    Thanks much
    -Tim

  10. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    09 Nov 2009
    Link to this post
    Hello Tim,

    How did you set up the web site?

    I am also testing with CSS files, and got the full path with http:// infront (rather than ftp://). Can you also try with a jpeg file for example?

    Best wishes,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  11. Tim
    Tim avatar
    10 posts
    Registered:
    09 Nov 2007
    09 Nov 2009
    Link to this post


    I access the site through something like:
    http://cmssamplesite.inalign.com/sitefinity/login.aspx


    The browser is trying to open the file up in a window instead of basic download.
    (If I right click, I get the sitefinity prompt to Rename/Delete/copy)
    If I click on somehting like a .aspx file, I get an error saying this file cannot be serverd

    Is there a way to download, without trying to open up the file ? 

    Thank you very much for your help.

    -Tim


  12. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    10 Nov 2009
    Link to this post
    Hi Tim,

    It is possible to extend the context menu of the Grid although it is not an easy task. Below are the steps you should follow:

    1. Create a new class CustomManageFiles that inherits from ManageFiles.
    2. Create a new class CustomFilesGrid that inherits from FilesGrid
    3. In ManageFiles override CreateChildControls method and create an instance of CustomFilesGrid.
    4. In CustomFilesGrid you need to override OnPreRender and call a custom method that will generate the new context menu item

    private void ContextMenu()
            {
                RadMenuItem item;        
                string itemName = "Download";
                item = new RadMenuItem(itemName);
                item.Value = itemName;
                item.PostBack = true;
                this.container.GridContextMenu.Items.Add(item);
                   
            }

    5. In CustomFilesGrid override CreateChildControls and subscribe for item click event of the context menu.

    void contextMenu_ItemClick(object sender, RadMenuEventArgs e)
         {
             switch (e.Item.Value)
             {
                case:"Download":
                 // TODO download item or something else
                break;
                case "Rename":
                   // TODO rename
                break;
             }   
         }

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
12 posts, 0 answered