Sitefinity ASP.NET CMS - Content Management System

KB Article

Home >  Support >  Knowledge Base >  KB Article
How to enable file download in the File Manager - ID#997
Rating:
Last Modified: 5/29/2008
Related categories: General;

Article information

Article relates to

 Sitefinity 3.2 SP2

Created by

 Yasen Kiprov


Since the release of Sitefinity 3.2 SP2, you are able to add a download link for every file in the folder structure of your web site. Here is how to do it:

1 Open the ~/Sitefinity/Admin/Files.aspx template.

2. In the ManageFiles control,  add the showDownloadLink attribute and set it to true:

<cc1:ManageFiles Visible="true" runat="server" ID="fileManager" showDownloadLink="true"

3. At the bottom of section <MasterTableView>, add this column:

<radG:GridHyperLinkColumn   
  UniqueName="DownloadLink" 
  Target="_blank" 
  Text="Download" 
  HeaderStyle-Width="20" 
  HeaderStyle-HorizontalAlign="center">  
</radG:GridHyperLinkColumn> 

This is what the Files grid should look like after making the above changes:

Download link at the Files tab

Some of the files, however, cannot be downloaded with a common HTTP request. For instance, files with extensions like .aspx, .ascx and .html will be treated as web pages. Files from folders like App_Data, and App_Master will be restricted.
Removing the download links for specific files can be achieved by overriding the IsDownloadable(string filePath) method in the FilesGrid control. By default, the method returns true for any path but it could be altered to return false for the App_Data folder or for the .exe files for instance.


Article Comments

AMC Online., 6/7/2008
Very useful for all users


Please Sign In to rate this article or to add it to your favorites.