After upgrading Archer to 126.96.36.199 or newer, some images are missing from Text Area fields. The images were pasted into the Text Area field in base64 format (long series of letters/numbers).
For example, the following Base64 string produces this image:
Unfortunately, this functionality was lost after addressing a Cross-Site Scripting vulnerability. With the attached Get Base64 Images tool, it can extract the base64 images and save to disk or back to the record. The tool can be used before or after the upgrade since it relies on the Archer Web Services API and REST API.
I recommend opening an Archer Support Case requesting your company be added to enhancement request ARCHER-22002 to add ability back, https://community.rsa.com/docs/DOC-32437?sr=search&searchId=2bba4aa5-ebb1-46ed-852d-39ff51f05a72&searchIndex=0, and https://community.rsa.com/docs/DOC-32619?sr=search&searchId=2c64ebee-40a8-46ec-bbd0-f1637b863043&searchIndex=0.
If the Text Area field values have not been modified since the upgrade, the base64 images are still in the database, but not displayed anymore. To determine if there are any Text Area fields with a base64 image, run the following SQL command against the Instance database to find content records that may contain an image:
SELECT mt.module_name, lt.level_name, td.content_id, td.field_id, ft.field_name, td.field_value, td.create_date, td.create_login
FROM tblIVTextData td
LEFT JOIN tblFieldTranslation ft ON ft.field_id = td.field_id
LEFT JOIN tblIVFieldDef fd ON fd.field_id = td.field_id
LEFT JOIN tblLevel l ON l.level_id = fd.level_id
LEFT JOIN tblModule m ON m.module_id = l.module_id
LEFT JOIN dbo.tblLevelTranslation LT ON l.level_id = LT.level_id
LEFT JOIN dbo.tblModuleTranslation MT ON m.module_id = mt.module_id
WHERE (field_value LIKE '%;base64,%')
- Save the Text field’s value to a text file. File name format is: ModuleId_LevelId_ContentId_FieldId.txt
- Save images from Text field to a file. File name format is: ModuleId_LevelId_ContentId_FieldId_#.png
- Save images back to a record’s Attachment or Image field. File name format is: FieldName #.png
- If images are saved back to record, the images can be appended, replaced, or cleared (used for testing).
- Data Grid View shows the records containing Base64 images and values from Report.
- Output contains a summary of what was found or files saved.
How to use:
- Create an Archer user account with System Administrator Role. This is needed to guarantee the user has access to all records and fields.
- Create an Archer Report and add the Text Area fields containing base64 images and the Attachment/Image field you want to save images back to.
- In the Archer Report, create a Filter to only return records that have ";base64," in the value.
- Run the Get Base64 Images tool and fill out the Archer Instance info.
- Login to get a session token.
- Enter the Report Id or GUID.
- Enter the Attachment/Image field id
- Select the options and click Start.
What’s happening behind the scenes:
- The tool uses the Web Services API to run the Archer Report containing the Text Area fields (with base64 images) and an Image/Attachment field (to save the images to). I prefer an Image field because it allows users to see a preview of image.
- For each record in the report, it reads the Text Area value and uses regular expressions to parse out each image in base64 format.
- After extracting the images, the REST API is used to upload the images. The File Id will match a file in the File Repository.
- After uploading images and getting list of File Ids, the record is updated with list using API.
- Depending on the option selected, the images can be appended to the list or replace the current list. This is needed if you want to use an existing field, but be careful…using the Replace option will overwrite current images/attachments. That’s why I recommend a new field.
This image demos when no options are selected. No action is taken on images or the record. This acts like a quick scan.
This image demos the Content records that were updated, how many images were added, and the file ids for the images after they were uploaded to File Repository.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.