function splitByLength(str: string, maxLength: number): string[] {
const parts = [];
for (let i = 0; i < str.length; i += maxLength) {
parts.push(str.slice(i, i + maxLength));
}
return parts;
}
......
const MAX_TEXT_CONTENT_LENGTH = 5000;
const textContentParts = splitByLength(fileContent, MAX_TEXT_CONTENT_LENGTH);
let textContentPatched = textContentParts.shift() || '';
fileContentAttribute = await this.lr.Attribute.createLongText(textContentPatched, facts);
while(textContentParts.length > 0) {
textContentPatched += textContentParts.shift();
await fileContentAttribute.set(textContentPatched);
}
it can be uploaded in parts like this