Message-ID: <376633524.3154.1485852224407.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_3153_617771357.1485852224407" ------=_Part_3153_617771357.1485852224407 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Binary files handling

Binary files handling

eZ Platform supports multiple binary file handling mechanisms by= means of an IOHandler interface. This feature is us= ed by the BinaryFile= , Media and Image Field Types.

Native IO handler 

The IO API is organized around two types of handlers:

The IOService uses both.

Configuration

IO handling can now be configured using semantic configuration. Assignin= g the IO handlers to ezplatform itself is configurable per siteaccess.= This is the default configuration:

=20
ezpublish:
    system:
        default:
            io:
                metadata_handler: default
                binarydata_handler: default
=20


metadata and binarydata handlers are configured in the ez_io extension. This is what the configuration looks like for the default hand= lers. It declares a metadata handler and a binarydata handler, both labelle= d 'default'. Both handlers are of type 'flysystem', and use the same flysys= tem adapter, labelled 'default' as well.

=20
ez_io:
    metadata_handlers:
        default:
            flysystem:
                adapter: default
    binarydata_handlers:
        default:
            flysystem:
                adapter: default
=20

 

The 'default' flysystem adapter's directory is based on your site settin= gs, and will automatically be set to %ezpublish_legacy.root_dir%/$var= _dir$/$storage_dir$ (example: /path/to/ezpublish_legacy/var/ez= demo_site/storage).

The native Flysystem handler.

league/flysystem (along with FlysystemBundle) is an abstract file handling library.

It is used as the default way to read & write content binary files i= n eZ Platform. It can use the local filesystem (our default configuration),= but is also able to read/write to sftp, zip or cloud filesystems (dropbox,= rackspace, aws-s3).

Handler options

Adapter

The adapter is the 'driver' used by flysystem to read/write files. Adapt= ers can be declared using oneup_flysystem as follows:

=20
oneup_flysystem:
    adapters:
        default:
            local:
                directory: "/path/to/directory"
=20

 

The way to configure other adapters can be found on the bundle's online documentation. Note that we do not use the Filesyste= m configuration described in this documentation, only the adapters.

 

------=_Part_3153_617771357.1485852224407--