Forum

Daniel Bieberstein
Participant
    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)
    Has successfully completed the online course Advanced (310)
    Has successfully completed the online course Advanced (320)
11 months, 1 week ago #63921
Up
0
Down
::

Hey Mr. Schreyer,

There’s no limitation on the upload set to be used with the content repository.

You can use the uploadeComplete event of the upload set to read the file and get the base64 value which then can be used in the contentFileAdd method as data to be uploaded to the content repository.

The following script will return the b64 value of the uploaded file when attached to the “uploadComplete” event of the upload set:

var reader = new FileReader();
var file = oEvent.getParameters(“files”).item.getFileObject();

reader.onload = function(e) {
var b64 = e.target.result;
console.log(“b64:”, b64); // b64 is the file – can be used to be uploaded in the content repo
};

reader.onerror = function(e) {
sap.m.MessageToast.show(“error”);
};
reader.readAsDataURL(file);

You can fine more information on reading the file here:

https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL

More information on the content repository can be found here:

How to use Simplifier Content Repository Plugin


and here

Content Repository

Best regards,

Daniel