Closed crewjam closed 3 years ago
Looks like the code that does the work would go here
https://github.com/steiza/docstore/blame/02f2a881ab103697b02ffe3e6ffa8d545caf0d8f/docstore#L280
Oh hey @crewjam, that's a great suggestion!
From poking around, it looks like most of the content is .pdf, but then I also saw a .xls. I started researching MIME types and it turns out there's a lot. But it turns out there's a MIME type map in the Python 3 standard library (!!!) My mind was blown.
I think https://github.com/steiza/docstore/commit/b904d1f8519a27e5d9fa256de0f1b71718cfd42d should resolve this issue.
I have no idea how busy @eby is, but he'd be the one to roll out this change.
This is live in production. Seems to work on the PDFs I tried.
Thanks for the effort, folks! Works for me. 🙇
It would be nice to have the
Content-type
response header set for attached files, which might make reading on e.g. Chrome, iOS webview, etc. more convenient. I'm not sure if settingcontent-disposition: attachment
prevents the webview from displaying the document in the native PDF viewer, but I can experiment with that if needed.A link that does display inline correctly: