I'll use a PDF document as an example, but this may also apply for other file types.
Opening attached PDFs in a new Window instead of forcing a download is such a trivial feature that I cannot believe it is not a natively supported feature.
It is almost 2020 and virtually no website forced you...
This add-on show/hide resource file size and extension.
user group permissions to show/hide.
Show file size and extension
Copy the contents of the folder "upload" to your forum
Go to your xenForo admin control panel...