Back to Devexpress

FileManagerSettings.ThumbnailFolder Property

aspnet-devexpress-dot-web-dot-filemanagersettings-0d9d004b.md

latest5.2 KB
Original Source

FileManagerSettings.ThumbnailFolder Property

Specifies the path to the folder that contains thumbnails.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue("")]
public virtual string ThumbnailFolder { get; set; }
vb
<DefaultValue("")>
Public Overridable Property ThumbnailFolder As String

Property Value

TypeDefaultDescription
StringString.Empty

The thumbnails root path.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to ThumbnailFolder
ASPxFileManager

.Settings .ThumbnailFolder

|

Remarks

The file manager stores content-based thumbnails in the ~\Thumb folder. Use the ThumbnailFolder property to specify a custom thumbnail location. Note that the folder that contains thumbnails must be placed physically inside the application folder.

Run Demo: ASPxFileManager - Features (Web Forms)Run Demo: FileManager - Features (MVC)

Security Considerations

  • If the file manager creates thumbnails in a public folder, it can result in unauthorized access to thumbnails of private files.
  • The thumbnail folder structure is based on the source folder’s relative path. If you change the root folder dynamically, the file manager may display incorrect thumbnails.

If you implement a multi-user application or dynamically change the root folder, we recommend that you specify the thumbnail folder dynamically based on the current user and restrict access to each user’s thumbnail folder. To learn more, see the following topic: Protect Thumbnails.

If the file manager uses the PhysicalFileSystemProvider (the ProviderType property is set to Physical), the control hides the thumbnail folder to prevent unauthorized access.

aspx
<dx:ASPxFileManager ID="fileManager" runat="server" ...>
    <Settings RootFolder="~/Content/FileManager/Files" ThumbnailFolder="~/Content/FileManager/Thumbnails" 
    AllowedFileExtensions=".jpg, .jpeg, .gif, .png" InitialFolder="~/Content/FileManager/Images"/>
    ...
</dx:ASPxFileManager>
csharp
ASPxFileManager fm = new ASPxFileManager();
fm.ID = "ASPxFileManager1";
fm.SettingsUpload.ValidationSettings.DisableHttpHandlerValidation = true;
Page.Form.Controls.Add(fm);
...
fm.Settings.RootFolder = Url.Content("~/Content/FileManager/Files");
fm.Settings.ThumbnailFolder = Url.Content("~/Content/FileManager/Thumbnails");
fm.Settings.InitialFolder = Url.Content("~/Content/FileManager/Images");
fm.Settings.AllowedFileExtensions=new String[] { ".jpeg", ".jpg", ".gif", ".png" };
vb
Dim fm As ASPxFileManager = New ASPxFileManager()
fm.ID = "ASPxFileManager1"
fm.SettingsUpload.ValidationSettings.DisableHttpHandlerValidation = True
Page.Form.Controls.Add(fm)
...
fm.Settings.RootFolder = Url.Content("~/Content/FileManager/Files")
fm.Settings.ThumbnailFolder = Url.Content("~/Content/FileManager/Thumbnails")
fm.Settings.InitialFolder = Url.Content("~/Content/FileManager/Images")
fm.Settings.AllowedFileExtensions = New String() {".jpeg", ".jpg", ".gif", ".png"}
csharp
@Html.DevExpress().FileManager( settings => {
    settings.Name = "fileManager";

    settings.Settings.ThumbnailFolder = Url.Content("~/Content/FileManager/Thumbnails");
    settings.Settings.RootFolder = Url.Content("~/Content/FileManager/Files");
    settings.Settings.InitialFolder = "~/Content/FileManager/Images";
    settings.Settings.AllowedFileExtensions= new String[] { ".jpeg", ".jpg", ".gif", ".png" };
    ...
}).BindToFolder(Model).GetHtml()

To learn more about thumbnails, see the following topic: Thumbnails

See Also

FileManagerSettings Class

FileManagerSettings Members

DevExpress.Web Namespace