图片上传处理

您好,有人能帮忙解释一下为什么图片没有上传成功,而是显示“上传处理中”吗?我尝试禁用了一个优化,但没有帮助。我使用的是最新的自托管 Discourse 版本,文件是 PNG 格式,大小为 1MB,使用的是 Air 主题。谢谢

1 个赞

您好,能否请您查看一下浏览器的控制台,看看发生这种情况时是否有任何错误?

1 个赞

非常奇怪,它在另一个浏览器 Safari 中运行正常,然后我切换回之前出现问题的 Brave,现在它也运行正常了。我所做的就是重启了我的电脑。
不过,我在 Brave 控制台中查看了它显示的内容。我不是程序员,不知道如何修改以消除这些警告。如果有人能提供帮助,我将不胜感激。谢谢!

***45Mixed Content: The page at '\u003cURL\u003e' was loaded over HTTPS, but requested an insecure font '\u003cURL\u003e'. This request has been blocked; the content must be served over HTTPS.***
***app.js:239 ℹ️ Discourse v3.5.0.beta2-dev — https://github.com/discourse/discourse/commits/18c8a8ffca — Ember v5.12.0***
***13deprecated.js:61 Deprecation notice: PluginOutlet arguments should now be passed using `@outletArgs=` instead of `@args=` (outlet: category-box-below-each-category) [deprecation id: discourse.plugin-outlet-args]***
***a @ deprecated.js:61***
***site.js:130 ✅  Using the new 'glimmer' topic list***
***hamforum.org/:1 Mixed Content: The page at 'https://hamforum.org/' was loaded over HTTPS, but requested an insecure element 'http://hamforum.org/uploads/default/original/1X/011bca162039029c26490fea3769b9d0fde6dd11.webp'. This request was automatically upgraded to HTTPS, For more information see https://blog.chromium.org/2019/10/no-more-mixed-messages-about-https.html***
***hamforum.org/:1 Mixed Content: The page at 'https://hamforum.org/' was loaded over HTTPS, but requested an insecure favicon 'http://hamforum.org/uploads/default/optimized/1X/d6407243bedd7a8b0323cffb345cb60750c7f8b8_2_32x32.png'. This request has been blocked; the content must be served over HTTPS.***
***hamforum.org/:1 Mixed Content: The page at 'https://hamforum.org/' was loaded over HTTPS, but requested an insecure element 'http://hamforum.org/uploads/default/optimized/1X/d5f25e2f27014348ef24a5b9e927a7641c1c5dea_2_512x512.webp'. This request was automatically upgraded to HTTPS, For more information see https://blog.chromium.org/2019/10/no-more-mixed-messages-about-https.html***
***4:1 Mixed Content: The page at 'https://hamforum.org/c/general/4' was loaded over HTTPS, but requested an insecure favicon 'http://hamforum.org/uploads/default/optimized/1X/d6407243bedd7a8b0323cffb345cb60750c7f8b8_2_32x32.png'. This request has been blocked; the content must be served over HTTPS.***
2 个赞

您是如何安装 Discourse 的?当您没有正确设置 HTTPS 时,就会发生这种情况。

2 个赞

我请了一位 Linux 专家帮我安装。不过他可能遗漏了什么。如果您能指明正确的方向,我相信他会尽快解决问题。

1 个赞

专家似乎没有遵循标准的安装指南。

您需要将 force_https 设置为 true。可以通过在您的 app.yml 中添加 DISCOURSE_FORCE_HTTPS: true 的环境变量并重新构建来完成。

3 个赞

好的,太棒了。我会把你的建议转达给专家,看看我们是否能解决这个问题。
你们太棒了。非常感谢!

1 个赞

我突然收到此错误,但仅在从移动设备上传时出现,从桌面设备上传时不会。我尝试登录控制台来执行“RAILS C”和“sitesetting.force_https = true”命令,但收到“command not found”错误。

我在论坛的管理员设置中没有看到“force https”。

有人能提供上面“ENV Var”步骤的说明吗?感谢您的时间。

尝试在您的 app.yml 文件中设置它。

感谢您的建议。我已包含该条目,保存了文件,并按照以下链接中的流程进行了重建:

在尝试清除浏览器缓存后,我能够从移动浏览器通过“正在处理上传”。谢谢!

1 个赞

这位专家执行了标准的安装。在容器内部,我得到这个:

# set|grep FORCE_HTTP
DISCOURSE_FORCE_HTTPS=true

行为是移动设备上的上传不起作用,但在移动设备上,切换到桌面视图可以使上传正常工作:

@noid --你使用的是什么移动浏览器和操作系统?

1 个赞