AppSettings.json
ImageVault 5 configurations are modified by editing the web.config file and the appsettings.json file (from v5.25). This page contains all configuration values set in appsettings.json. To see configuration options for web.config, see the application settings page.
MailService
Settings here contains configuration options controlling the mail service added in v5.25.
SendGridApiKey
The Api key for the sendgrid instance to use for sending mail.
{
"MailService": {
"SendGridApiKey": "mySecretApiKey"
}
}
SendGridConsentTemplateId
The id of the sendgrid template used for sending consent agreement mails.
{
"MailService": {
"SendGridConsentTemplateId": "some-nice-template-id"
}
}
SenderEmailAddress
The email address used as sender when sending emails.
{
"MailService": {
"SenderEmailAddress": "no-reply@imagevault.app"
}
}
SenderName
The name used as sender when sending emails.
{
"MailService": {
"SenderName": "ImageVault Mail Service"
}
}
Common settings
Common ImageVault Ui configuration settings are contained in this section. Added in v5.26.
EnableSwagger
Swagger is an embedded documentation for the REST api. This is enabled by default but can be disabled by setting this to false.
{
"ImageVault": {
"Ui": {
"Common": {
"EnableSwagger": false
}
}
}
}
CORS settings
Settings here contains configuration options controlling CORS options added in v5.26. Cors settings can be used to tighten the security regarding the ImageVault service.
AllowedOrigins
Supply a list of all origins that are allowed separated by a semicolon. If left empty, all origins are allowed. Default is empty. Will be reflected in the services Access-Control-Allow-Origin header.
{
"ImageVault": {
"Ui": {
"Cors": {
"AllowedOrigins":"https://office.imagevault.app;https://mysitevision.com"
}
}
}
}
AllowedHeaders
Supply a list of all HTTP headers that are allowed separated by a semicolon. If left empty, all headers are allowed. Default is empty. Will be reflected in the services Access-Control-Allow-Headers header.
{
"ImageVault": {
"Ui": {
"Cors": {
"AllowedHeaders":"Content-Type;x-requested-with"
}
}
}
}
AllowedMethods
Supply a list of all HTTP methods that are allowed separated by a semicolon. If left empty, all methods are allowed. Default is empty. Will be reflected in the services Access-Control-Allow-Methods header.
{
"ImageVault": {
"Ui": {
"Cors": {
"AllowedMethods":"GET;POST"
}
}
}
}
ExposedHeaders
Supply a list of all HTTP headers that are allowed to be available to scripts running in the browser separated by a semicolon. If left empty, the header value is not sent to the browser. Default is empty. Will be reflected in the services Access-Control-Expose-Headers header.
{
"ImageVault": {
"Ui": {
"Cors": {
"ExposedHeaders":"Content-Encoding;Last-Modified"
}
}
}
}
SupportsCredentials
If active, will indicate that the credentials can be available to browser scripts. Default is true. Will be reflected in the services Access-Control-Allow-Credentials header.
{
"ImageVault": {
"Ui": {
"Cors": {
"SupportsCredentials": false
}
}
}
}
Allowed files
From v5.29
In order to prevent unwanted files from being uploaded to ImageVault, a list of allowed file types can be configured. This setting will affect all upload functions in ImageVault, including normal asset upload, upload for agreements and consent agreements.
As default all file types are allowed.
Note
Beware that if you exclude pdf files, consent agreements will not be able to be uploaded.
An example of a configuration that allows all images with exception for svg files is shown below:
{
"ImageVault": {
"Ui": {
"AllowedFiles": {
"Include": [
"image/*"
],
"Exclude": [
"image/svg+xml",
".svg"
]
}
}
}
}
Include
Supply a list of mime type or file extension patterns that are allowed to upload. The following patterns are supported
type/subtype
- Matches a specific mime type. Example:image/svg+xml
type/*
- Matches all subtypes of a specific type. Example:image/*
*/subtype
- Matches all types with a specific subtype. Example:*/pdf
extension
- Matches a specific file extension. Example:.svg
The leading dot is optional.
In general, the following rules are applied:
- if the pattern contains a slash, it is treated as a mime type
- * in the pattern matches any number of characters
Has no default value.
Exclude
Supply a list of mime types or file extension patterns that are not allowed to upload.
Follows the same rules as the Include
setting.
Has no default value.
DefaultRule
If a file is not matched by any of the Include
or Exclude
rules, this setting will determine if the file is allowed or not.
As default, this is True if no include or exclude rule has been defined. If any include or exclude rule has been defined, default is False.