# controller\_file\_id

Source: https://zotonic.com/docs/1556/controller_file_id

URI: https://zotonic.com/id/1556

Language: en



Redirect to the controller controller\_file.

This controller maps a resource id to the filename of the medium associated with the resource.

For the redirect it uses the dispatch rule defined in the dispatch options.

Examples from mod\_base:

```erlang
{media_inline, ["media","inline","id",id], controller_file_id, [ {dispatch, media_inline}, {ssl, any} ]},
{media_inline, ["media","inline",'*'], controller_file, [ {content_disposition, inline}, {ssl, any} ]},
```

The first dispatch rule will redirect to the second. If no associated file was found, then a 404 is returned.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1556?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1556?language=en>)
