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

Binary and Media download

Files stored in BinaryFile or Media Fields are not publicly down= loadable via their uri property. Unlike image files, whic= h 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 fea= ture has been added (specifications).

Public API: Binary FieldTypes Value url pro= perty change

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

=20
/content/download/{contentId}/{fieldId}
=20

For=20 more information about Publi= c 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 U= RL, of the same format than the Public API, prefixed with the same host tha= n 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 siteacces= s based on the fieldId's language (the legacy storage engine uses one field= Id per language).

Testing

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

 

------=_Part_4021_1443749173.1485856395297--