Content Disposition Bundle

Install Package

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
blog comments powered by Disqus

Created by:

Categories:

Downloads:

120

Stars:

0

Forks:

0

Created:

Updated: