Image upload functionality using Rich Text Editior in Pega 7.1.7
We want to leverage the image uploading feature available in rich text editor,
We analyzed its current behavior still we need clarity on some points to implement it as per our requirements.
1. We found that activity "pzUploadRTEImage" saves the complete image data in database, And after that stream rule "pzRTEImageUploadResponse" is responsible to show the content on the UI.
I think the rule "pzRTEImageUploadResponse" uses path of a file server(""/rteImages/) to show the data on UI, Please confirm.
If yes then what if the data is deleted from the file server, How Pega (rule names?) will fetch the data from database and show it on UI (or put back at the file server path).
2. The activity "pzUploadRTEImage" is final, So if we want to put the image content other than the OOTB table "PEGA_DATA.pr_data_file" how can we do that?
3. The clipboard property associated with the rich text editor has the data entered by the user and the HTML decorators to render the data properly back in the control. In our project, we need to pass this data to downstream interfacing systems. They only want the user entered text and not the HTML tags. Is there any utility function available in PEGA to strip-off the HTML decorators from the rich text?
4. How can we validate the the size of the image being uploaded?, Also can we put check on the combined size of all the images uploaded using the same Ritch Text Editor?
***Updated by Moderator: Vidyaranjan. Removed user added srcreated and Ask the Expert tags. Apologies for confusion, shouldn't have been an end-user option
Are you planing to replace the OOTB image upload functionality in RTE?
1)The image gets saved in base64 format in the database, so even if it is deleted in fileserver it will be recreated.
2)The images uploaded in RTE are instances of Data-Content-Image class and are stored in pr_data_file. I believe just creating instances of a different class/table won't work as there is engine side code that supports data content images. Someone from engine team will confirm this.
3)rich text content is supposed to be markup and there is no OOTB utility to convert it to text. If plain text is what is needed i suggest using just textarea.
4)You can figure it on client form input file tag or use Base64Util on pyfilesource in the activity.
Posted: 4 years ago
Posted: 21 Jul 2016 11:58 EDT
Aasif Qureshi (AASIFQURESHI)
NTT DATA Deutschland GmbH
Lead Technical Consultant
NTT DATA Deutschland GmbH