This is an ongoing issue even with the latest Thunderbird 102.x where attachments downloaded via IMAP just won't save or will be corrupt which is a huge interruption to workflow or if you come back later to find out the file you thought you saved is invalid/corrupt and you have perhaps deleted the e-mail.
1. Click on "Settings". then go to "General".
2. Scroll to the bottom to find "Config Editor".
3. Search for "mail.
4. Search for "browser.cache.memory.max_entry_size" and set it to 40000000
5. Remember to restart Thunderbird to apply the changes.
After that your attachments will download properly (hopefully!).
Make sure to clear the Thunderbird cache, this should fix things if the above alone does not fix it.
References: https://support.mozilla.org/en-US/questions/1268926
https://bugzilla.mozilla.org/show_bug.cgi?id=1589649
thunderbird, attachment, download, corrupt, filesize, bytes, solutionthis, ongoing, attachments, interruption, workflow, invalid, deleted, quot, settings, scroll, config, imap, mime_parts_on_demand, references, https, mozilla, org, en,