Global navigation

   Documentation Center
   eZ Studio & eZ Platform
     User Manual
     Technical Manual
     Glossary
   eZ Publish 4.x / legacy

 
eZ Publish (5.x)

eZ Publish 5.x | For eZ Platform & eZ Studio topics see Technical manual and User manual, for eZ Publish 4.x and Legacy topics see eZ Publish legacy

Skip to end of metadata
Go to start of metadata

Files stored in BinaryFile or Media Fields are not publicly downloadable via their uri property. Unlike image files, which are public, those must follow the permission scheme for security reasons.

Download links for those files must use a specific route, and not the uri property from the FieldType's value.

The easiest way is to use the regular ez_render_field twig helper, that will generate a working link. In eZ Publish Platform 5.x, the legacy content/download module will be used. Starting from eZ Platform 2015.05, a Symfony content/download feature has been added (specifications).

Public API: Binary FieldTypes Value url property change

The `url` property of {BinaryFile\Value} and {Media\Value} now contain the absolute URL to the file, with the format

For more information about Public API see the documentation.

 

REST API: The `url` property contains a valid download URL

The url property of Binary Fields in REST contain a valid URL, of the same format than the Public API, prefixed with the same host than the REST Request.

For more information about REST API see the documentation.

 

New download route

The download route documented above will redirect to the right siteaccess based on the fieldId's language (the legacy storage engine uses one fieldId per language).

Testing

Limited to the BinaryFile and Media fieldtypes.
We must check that the url property in Field Value for these fieldtype is a valid /content/download URI, both in Public API and REST. In REST, the URL must redirect to the language of the attribute (e.g. fre-FR attribute => fre-FR siteaccess, etc).

 

  • No labels