Content Disposition Bundle

eZ Platform bundle that gives the ability to specify content dispositions for downloads.

ContextualCode\EzPlatformContentDispositionBundle

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 app/AppKernel.php by adding this line in the registerBundles method:
    public function registerBundles()
    {
        $bundles = array(
            ...
            new ContextualCode\EzPlatformContentDispositionBundle\ContextualCodeEzPlatformContentDispositionBundle(),
        );
    }

Usage

In some parameters.yml file, you can specify:

  • A default content disposition:

    ezsettings.global.download_content_disposition.default: inline
  • A content disposition per mimetype:

    ezsettings.global.download_content_disposition.mimetype:
      "application/pdf": inline
      "application/msword": attachment

Created by:

Categories:

Downloads:

8396

Stars:

0

Forks:

0

Created:

Updated: