This content is archived. See latest version here.

Last updated: Mar 25 2013

Note: This topic has no later version.

Introduction

The EPiServer CMS File System is based on the Microsoft Virtual Path Providers (VPP) technology – EPiServer CMS uses VPP to serve static files to visitors from an underlying virtual file system. Refer to the MSDN article ASP.NET compilation overview for more information.

The File Management system in EPiServer CMS is accessed and used by web editors in the EPiServer UI where they can carry out tasks such as creating uploading files and creating a folder structure. When developing EPiServer CMS solutions developers can also create functionality to upload, create, move, delete files and folders programatically.

For more general information regarding the File Management system in EPIServer CMS, refer to the Administrator’s User Guide in EPiServer CMS.

The EPiServer CMS file system is by default a versioned file system and stores the files in a GUID structure in the VPP folder. In EPiServer CMS all files are stored using the VirtualPathVersioningProvider (which always stores the path and file name in the database and the content as a file with a GUID as name).hanging maximum file size for upload

Changing maximum file size for upload

In web.config, change the parameters maxAllowedContentLength and maxRequestLength:

<system.webServer>
  <security>
    <requestFiltering>
      <requestLimits maxAllowedContentLength="1048576000" />
    </requestFiltering>
  </security>
</system.webServer>

Events

The EPiServer CMS API provides interfaces and classes for handling file and folders, see the EPiServer.Web.Hosting namespace.

By extending these classes when implementing your own file system (or using the existing EPiServer CMS File Management System) you can raise and subscribe to events for file and directory actions such as adding, deleting, renaming, versioning control, etc. All events support the pre- and post-mechanism (which means OnAdding – OnAdded).

Page folders and security

Each page in EPiServer CMS can have its own dedicated folder to store files. This feature is called Page Files. This folder when created is a “regular” folder with a numeric name. This number has nothing to do with the specific page’s ID – the folder ID is picked according to a specific sequence. The ID of the page folder is stored in a property called PageFolderID on the page, see below.

C#
int folderId = (int) Current.Property["PageFolderID"].Value;

Note that creating the page folder and storing files in the folder is also is tied to the page’s access settings. If a visitor does not have access rights to read the page then they will not be able to read the files in the page’s folder either.

One way to get the page folder from code is to call CurrentPage.GetPageDirectory(true) note that it will only work if the folder already exists or if you are logged in as an editor with the access rights in order to create pages.

See also

More information on file management and Virtual Path Providers in EPiServer can be found in the following sections:

Comments