contextualcode / ezplatform-content-disposition-bundle
eZ Platform bundle that gives the ability to specify content dispositions for downloads.
Installs: 14 379
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Forks: 1
Type:ezplatform-bundle
pkg:composer/contextualcode/ezplatform-content-disposition-bundle
Requires
- ibexa/content: ^4.3
This package is not auto-updated.
Last update: 2025-10-31 00:58:52 UTC
README
This bundle gives the ability to customize content dispositions (inline or attachment) for downloads.
You can specify the default content disposition, and content dispositions per mime type.
Installation
- Run composer require:
$ composer require contextualcode/ezplatform-content-disposition-bundle
- Enable this bundle in config/bundles.phpby adding this line:
    return [
        ...,
        ContextualCode\EzPlatformContentDispositionBundle\ContextualCodeEzPlatformContentDispositionBundle::class => ['all' => true],
    ];
Add this to your routes.yaml:
content_disposition:
  resource: '@ContextualCodeEzPlatformContentDispositionBundle/Resources/config/routing.yml'
Usage
In some parameters block, for example in config/services.yaml, you can specify:
- A default content disposition: - ibexa.site_access.config.global.download_content_disposition.default: inline
- A content disposition per mimetype: - ibexa.site_access.config.global.download_content_disposition.mimetype: "application/pdf": inline "application/msword": attachment
- Make files - cache-control: public, s-maxage=%download_content_disposition.download_file_ttl%and vary by user context hash (default:- false).- ibexa.site_access.config.default.download_content_disposition.public_download: true ibexa.site_access.config.default.download_content_disposition.download_file_ttl: 86400- if - download_content_disposition.download_file_ttlsetting not defined,- content.default_ttlwill be used.