You use the SiteAssets folder in an MDriven Turnkey application to publish static files whose file types may not otherwise be served by IIS or IIS Express, such as OpenDocument report templates.
What SiteAssets is for
SiteAssets is the static-asset location for files that your Turnkey application must make available to the web server. It has additional MIME type mappings, which tell IIS or IIS Express what content type to use when serving particular file extensions.
A MIME type identifies the kind of file delivered to a browser or client. For example, an .ods file is an OpenDocument spreadsheet. Without a mapping for that extension, a web server may not deliver the file.
Use SiteAssets for files such as:
- OpenDocument report templates:
.odt,.ods, and.odp - Video files:
.mp4 - Scalable Vector Graphics:
.svg - XPS files and supported font files
- Application branding assets, such as a logo or favicon; see HowTos:Add logotype and favicon
For example, place an OpenDocument text template named InvoiceTemplate.odt in SiteAssets when the application needs to make that template available through the web server.
SiteAssets location
In a Turnkey application, SiteAssets is located under the asset project folder:
_AssetsTK\SiteAssets
For example, the logo described in HowTos:Add logotype and favicon is placed in _AssetsTK\SiteAssets after you upload it through portal.mdriven.net or MDriven Designer.
Add a static file
- Open your application's
_AssetsTK\SiteAssetsfolder. - Copy the file into that folder. For example, copy
MonthlyReport.odsfor an OpenDocument spreadsheet report template. - Keep the file extension that identifies the file type. The configured MIME mappings are extension-based.
- Build or deploy the application as required by your normal Turnkey workflow.
- Request the file through the application path where it is exposed and verify that the web server delivers it.
If you work with a local Turnkey installation and want source assets to remain outside the Turnkey core file tree, you can use directory symbolic links as described in Documentation:Turnkey local development tips.
Configured MIME types
The following MIME type mappings are included for SiteAssets.
| File extension | MIME type | Typical use |
|---|---|---|
.mp4
|
video/mp4
|
MP4 video |
.odt
|
application/vnd.oasis.opendocument.text
|
OpenDocument text report template |
.ods
|
application/vnd.oasis.opendocument.spreadsheet
|
OpenDocument spreadsheet report template |
.odp
|
application/vnd.oasis.opendocument.presentation
|
OpenDocument presentation |
.xps
|
application/octet-stream
|
XPS document |
.eot
|
application/vnd.ms-fontobject
|
Embedded OpenType font |
.ttf
|
application/octet-stream
|
TrueType font |
.svg
|
image/svg+xml
|
SVG image, such as a logo |
How the mappings avoid IIS conflicts
Some MIME types can already be configured globally in IIS, depending on the environment. Adding the same extension again can cause a configuration conflict.
For extensions that may already exist globally, the SiteAssets configuration removes the existing mapping before adding its own mapping. The .odt handling follows this pattern:
<remove fileExtension=".odt" />
<mimeMap fileExtension=".odt" mimeType="application/vnd.oasis.opendocument.text" />
This means that SiteAssets can provide its intended mapping even when IIS has a global mapping for the same extension.
Choose the correct location
Place a file in SiteAssets when it is a static application asset that must be served and its extension needs one of the available MIME mappings. Do not treat SiteAssets as a replacement for application navigation or data presentation configuration; those topics are covered by Documentation:Navigation and Documentation:Showing data.
If your extension is not listed
The SiteAssets MIME mappings listed on this page are the available configured mappings. If you need a different file extension to be served from SiteAssets, contact MDriven and specify the extension and required MIME type so it can be considered for a future build.
