Forum

Armin Winkler
Moderator
    Has successfully completed the online course Introduction
    Has successfully completed the online course Intermediate (200)
    Has successfully completed the online course Advanced (300)
    Has successfully completed the online course Basics (100)
2 months, 1 week ago #64021
Up
0
Down
::

Hi Jens,

 

one short addition to Daniel’s reply: Be aware that the script code provided by him actually returns a data URL instead of the sole file content encoded as base64 string. However, the Content Repository plugin slot ‘contentFileAdd’ only accepts the base64 encoded content without the data prefix and mime type given in a data URL. Therefore, you’d have to remove that part from the data URL output given from the FileReader to extract only the base64 value. You could achieve this by changing the related line of code into the following:

 

var b64 = e.target.result.split(“,”).pop();

 

Kind regards,

 

Armin