[SPIP] Submitted : New translation : |embarque_fichier

SPIP

Article submitted

The article « New translation: |embarque_fichier
(https://www.spip.net/ecrire/?exec=article&id_article=6749) » is submitted
for publication. on Saturday 17 September 2022.


New translation: |embarque_fichier

Saturday 17 September 2022 , by jack

The filter |embarque_fichier allows you to replace a file embedded in a
tag with its equivalent in Data URI Scheme
(https://en.wikipedia.org/wiki/Data_URI_scheme) encoded in base 64

Table of contents

  • Example
  • See also

The filter |embarque_fichier applied to a path to a file returns the
base 64 encoded « Data URI Scheme » version of that file, which directly
contains the data. Of the form: data:[<mediatype>][;base64],<data>.

Example|Back to the table of contents

<img src="

[


(


#CHEMIN


{images/tdm.png}


)


]

">

will produce the tag
<img src="squelettes/images/tdm.png">

while

<img src="

[


(


#CHEMIN


{images/tdm.png}


|embarque_fichier


)


]

">

will produce the tag
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAFo9M/3AAAABGdBTUEAANb...>

…so the file will not be loaded from the source but displayed directly
from the encoded string.

NB: this filter is provided by the plugin-dist compressor through the
PHP function filtre_embarque_fichier
(https://code.spip.net/autodoc/tree/plugins-dist/compresseur/compresseur_fonctions.php.html#function_filtre_embarque_fichier).

Caution : the result provided by this filter is not supported by all
browsers or courriers.

See also|Back to the table of contents

Tags

Filters

— Sent by SPIP (https://www.spip.net/)


rubon199-7e493.jpg