.Accept

Restrict what can be dropped on instances of the app. Accepting means allowing a file to be dropped into an instance.

Required file type for the .Accept file: accept-1.

A gallery app may want to disallow dropping anything but images into it. A content placeholder may only want to accept anything that implements the .Inline method. The .Accept file allows you to set these restrictions.

Usage

If the .Accept file does not exist, the app will not accept anything.

The .Accept file can be configured via the following string attributes:

  • default,
  • placeholder-N, where N is any valid placeholder: [0..255].

default will apply to all placeholders, while you can also specify rules for concrete placeholders.

The attribute values must be a space separated lists of app methods. There are 2 special values:

  • .Image - currently only the built-in image-1 app implements it, and
  • .None - which can not be implemented.

Built-in methods you will likely want to use:

  • .Inline,
  • .Request,
  • .Page.

You can also use user-defined methods, like .foo. User defined methods start with a dot followed by a lower-case letter. This allows you to create applications that only allow one to drop specific file types - those that implement that interface.

Validating the .Accept file

Open it in your browser to validate it.

Examples

Accept nothing

{
    "title": "",
    "link": "",
    "type": "accept-1",
    "statusCode": 0,
    "attr": {}
}

Accept everything

{
    "title": "",
    "link": "",
    "type": "accept-1",
    "statusCode": 0,
    "attr": {
        "default string": ""
    }
}

Accept pages only

{
    "title": "",
    "link": "",
    "type": "accept-1",
    "statusCode": 0,
    "attr": {
        "default string": ".Page"
    }
}

Accept images only

{
    "title": "",
    "link": "",
    "type": "accept-1",
    "statusCode": 0,
    "attr": {
        "default string": ".Image"
    }
}

Accept files only that can be inlined

{
    "title": "",
    "link": "",
    "type": "accept-1",
    "statusCode": 0,
    "attr": {
        "default string": ".Inline"
    }
}

Accept files that can be inlined or served as requests

{
    "title": "",
    "link": "",
    "type": "accept-1",
    "statusCode": 0,
    "attr": {
        "default string": ".Inline .Request"
    }
}

Only accept files in placeholder 1 that can be inlined

{
    "title": "",
    "link": "",
    "type": "accept-1",
    "statusCode": 0,
    "attr": {
        "placeholder-1 string": ".Inline"
    }
}