XI – Files Dir

XI – Files Dir

IntraWeb previously supported a Files and FilesNC URL path. This allowed serving of static content, and was also useful for providing pictures used in templates. IPM eliminates the need for this directory, however we also must preserve this feature for compatibility reasons. There are some conflicts however, and here are the changes that are in XI.

Files Dir – Pre XI

Pre XI, a files subdirectory of the application directory contained static files. These files were often used in support of templates, for serving generated content as links, user downloads, or by third party components. This directory could be referenced by /Files/, Files/, /FilesNC/ or FilesNC/. FilesNC would return additional headers to the browser to tell it not to cache the content.

The Templates directory was also a subdirectory of the application directory. This made Templates and Files siblings, an a /Files/ or Files/ path in a template would not resolve during development, although it would at run time. Because of this, IntraWeb also supported ../Files/ and ../FilesNC/. This allowed templates to be more easily designed, but still run. The items resolved at both design time and run time.

Conflicts in XI

/Files/, Files/, /FilesNC/ and FilesNC/ all map into IPM url space. This creates a conflict, and the ../ forms create a completely invalid URL. The simplest solution would be to eliminate the ../ option and force the moving of Files content from <app dir>Files to <app dir>wwwrootFiles. However this creates undue changes to third party components and existing code. Because of this, XI will provide special handling for all forms of the Files URL and preserve compatibility.

Files Dir – XI

While XI will provide compatibility for the Files URL, there are some small conflicts with IPM that will remain. Whenever XI encounters any of the File dir URLs, it will first search for matching content in <app dir>Files. If a match is found, it will be served exactly as before as static content. No IPM features will be applied such as variables, or other processing. If no match is found, then the URL will be passed to IPM and handled as a normal IPM request which would map to <app dir>/wwwroot/Files/.

If the ../ form of Files for FilesNC is used, only <app dir>/Files will be searched. This form will never be passed to IPM as the URL is invalid in the context of IPM.

Sessions

Any file served from wwwroot, including wwwrootFiles require a session. A session will be created if one does not exist. However files served from <app root>Files are served without the requirement of a session.