# 授权扩展列表包含非标准扩展名称

**URL:** <https://meta.discourse.org/t/authorized-extensions-list-with-non-standard-extension-names/133844>\
**Category:** Support\
**Created:** [2019年十一月19日 17:38 UTC](https://meta.discourse.org/t/authorized-extensions-list-with-non-standard-extension-names/133844 "2019-11-19T17:38:23Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisGammell](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisgammell/32/114659_2.png) [@ChrisGammell](https://meta.discourse.org/u/ChrisGammell)\
**Post date:** [2019年十一月19日 17:38 UTC](https://meta.discourse.org/t/authorized-extensions-list-with-non-standard-extension-names/133844/1 "2019-11-19T17:38:23Z")

</div>

我运营一个支持开源软件 KiCad 的论坛（[https://forum.kicad.info](https://forum.kicad.info)）。在最近一次升级后，用户经常上传的一些文件扩展名无法正常工作。相关讨论线程如下：

> **[Minor errors after upgrade](https://forum.kicad.info/t/minor-errors-after-upgrade/19757/12)**
>
> Yeah, I think it might have been that the default “allowed” extensions changed. They used to be “.jpg” instead of “jpg”, but I just saw that it’s different. I tried adding the new extensions as well: Trying the attachment again:...

我关注的关键问题是：只有包含下划线的扩展名出现了问题。在 KiCad 之前，我从未见过带有下划线的文件扩展名，但这类扩展名却是该软件中文件扩展名的重要组成部分。例如，电路板文件的扩展名为“.kicad\_pcb”，封装文件的扩展名为“kicad\_mod”。

我已将所有文件扩展名以及星号（\*）都列在“允许的扩展名”中，希望能解决这个问题。我也尝试在 Git 仓库中搜索，但未能找到任何关于扩展名类型的限制（尽管这并不意味着不存在此类限制）。

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/5/a5998f35f44470b99ee530221d13da919609acf4.png)

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2019年十一月21日 02:40 UTC](https://meta.discourse.org/t/authorized-extensions-list-with-non-standard-extension-names/133844/2 "2019-11-21T02:40:35Z")

</div>

所以只有带下划线的出错了？

---

<div class="post-metadata">

**Author:** ![ChrisGammell](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisgammell/32/114659_2.png) [@ChrisGammell](https://meta.discourse.org/u/ChrisGammell)\
**Post date:** [2019年十一月21日 04:07 UTC](https://meta.discourse.org/t/authorized-extensions-list-with-non-standard-extension-names/133844/5 "2019-11-21T04:07:45Z")

</div>

是的，没错。

---

<div class="post-metadata">

**Author:** ![ChrisGammell](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisgammell/32/114659_2.png) [@ChrisGammell](https://meta.discourse.org/u/ChrisGammell)\
**Post date:** [2019年十二月27日 14:32 UTC](https://meta.discourse.org/t/authorized-extensions-list-with-non-standard-extension-names/133844/6 "2019-12-27T14:32:51Z")

</div>

我没想到要在另一个实例上试试，只是为了确认一下。

我刚刚启用了相同的扩展（“kicad\_mod”），上传功能正常。但是，它表现出相同的行为：当你点击帖子中的文件链接时，会跳转到默认页面，显示“哎呀！该页面不存在或是私有的”。

这是否可能与生成的链接有关，而不是实际的上传问题？下划线是允许的吗？

例如，我刚才创建的链接是“/uploads/short-url/913bC7GjTf4cxyYtkr1Ej67ngER.kicad\_mod”。

~~供参考，我使用的是 S3 实例进行存储~~ 我刚刚在测试实例上再次确认，它使用的是本地存储。

---

<div class="post-metadata">

**Author:** ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)\
**Post date:** [2019年十二月27日 15:46 UTC](https://meta.discourse.org/t/authorized-extensions-list-with-non-standard-extension-names/133844/7 "2019-12-27T15:46:04Z")

</div>

感谢报告。我将在下周检查该问题。

---

<div class="post-metadata">

**Author:** ![davidsrsb](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@davidsrsb](https://meta.discourse.org/u/davidsrsb)\
**Post date:** [2019年十二月28日 01:42 UTC](https://meta.discourse.org/t/authorized-extensions-list-with-non-standard-extension-names/133844/8 "2019-12-28T01:42:51Z")

</div>

这是论坛用户的另一个示例  
[https://forum.kicad.info/uploads/short-url/kkB1iEtT2JAEbNFZP4YclKPmgbC.kicad\_pcb，他以为自己的上传已成功](https://forum.kicad.info/uploads/short-url/kkB1iEtT2JAEbNFZP4YclKPmgbC.kicad_pcb%EF%BC%8C%E4%BB%96%E4%BB%A5%E4%B8%BA%E8%87%AA%E5%B7%B1%E7%9A%84%E4%B8%8A%E4%BC%A0%E5%B7%B2%E6%88%90%E5%8A%9F)  
又是一个下划线。用户并非试图使用 Unicode 字符。

---

<div class="post-metadata">

**Author:** ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)\
**Post date:** [2020年一月3日 04:40 UTC](https://meta.discourse.org/t/authorized-extensions-list-with-non-standard-extension-names/133844/9 "2020-01-03T04:40:11Z")

</div>

现在已通过以下提交修复：

> <https://github.com/discourse/discourse/commit/cfd1549abe20d63f6c384d5d12d4b7e90357ca20>

---

<div class="post-metadata">

**Author:** ![ChrisGammell](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisgammell/32/114659_2.png) [@ChrisGammell](https://meta.discourse.org/u/ChrisGammell)\
**Post date:** [2020年一月8日 16:08 UTC](https://meta.discourse.org/t/authorized-extensions-list-with-non-standard-extension-names/133844/10 "2020-01-08T16:08:18Z")

</div>

当此功能被包含在测试版构建中时，我们会有某种通知方式吗？

---

<div class="post-metadata">

**Author:** ![ChrisGammell](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisgammell/32/114659_2.png) [@ChrisGammell](https://meta.discourse.org/u/ChrisGammell)\
**Post date:** [2020年二月5日 17:39 UTC](https://meta.discourse.org/t/authorized-extensions-list-with-non-standard-extension-names/133844/11 "2020-02-05T17:39:01Z")

</div>

刚在我们的本地安装上测试过，运行良好。感谢更新！

---

<div class="post-metadata">

**Author:** ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)\
**Post date:** [2020年二月5日 17:39 UTC](https://meta.discourse.org/t/authorized-extensions-list-with-non-standard-extension-names/133844/12 "2020-02-05T17:39:34Z")

</div>


