# 默认直接打开 PDF（而非下载）

**URL:** <https://meta.discourse.org/t/make-pdfs-open-directly-not-via-download-by-default/388190>\
**Category:** Feature\
**Tags:** completed, pdf-previews\
**Created:** [2025年十一月11日 21:39 UTC](https://meta.discourse.org/t/make-pdfs-open-directly-not-via-download-by-default/388190 "2025-11-11T21:39:03Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [2026年二月17日 09:43 UTC](https://meta.discourse.org/t/make-pdfs-open-directly-not-via-download-by-default/388190/18 "2026-02-17T09:43:42Z")

</div>

理论上，mp4 应该内联提供：

> <https://github.com/discourse/discourse/blob/2d615863d2613a7237451b8997c3c8c6583e7ae8/lib/file_helper.rb#L191C2-L194C6>

它使用了：

> <https://github.com/discourse/discourse/blob/2d615863d2613a7237451b8997c3c8c6583e7ae8/lib/file_helper.rb#L205C3-L207C6>

> [@Canapin](#):
>
> 预期行为：[https://d.canapin.dev/uploads/default/original/2X/4/4fb882b8ca5a0b0e3d75ff932506d57325f5582c.mp4](https://d.canapin.dev/uploads/default/original/2X/4/4fb882b8ca5a0b0e3d75ff932506d57325f5582c.mp4)

您是如何实现这一点的？即与 [unicyclist.com](http://unicyclist.com) 有何不同？

---

_[View the full topic](https://meta.discourse.org/t/make-pdfs-open-directly-not-via-download-by-default/388190)._
