Ahh, I see. Discourse by default sets any non-image attachments with the Content-Disposition as “attachment” which will treat it as a download only.
You might be able to do something similar to the Inline PDF Previews, which seems to handle this same problem, but for PDF uploads.