...
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
Code Block |
---|
/content/download/{contentId}/{fieldId} |
Info |
---|
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.
Info |
---|
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).