Moreover, the downloaded file might have uppercase letters in the name but in the link it was converted to lowercase. Hence, there was need to list the directory containing the file and see if there was a file, e.g. __uploads/F0123A4B56C/Image.JPG, whose name after conversion to lowercase matched the link.
To support the attachments in the mattermost output type, it was necessary to rewrite the image links to reference the following path in the ZIP file:
Moreover, the downloaded file might have uppercase letters in the name but in the link it was converted to lowercase. Hence, there was need to list the directory containing the file and see if there was a file, e.g. __uploads/F0123A4B56C/Image.JPG, whose name after conversion to lowercase matched the link.