添付ファイル/アップロードの最大サイズを変更する

:bookmark: このガイドでは、セルフホスト型Discourseインスタンスの最大添付ファイルアップロードサイズを変更する方法について説明します。

:person_raising_hand: 必要なユーザーレベル: システム管理者

デフォルトの添付ファイルアップロードサイズ制限は10MBです。

Discourseをセルフホストしており、10MBを超えるアップロードを許可する必要がある場合は、以下の手順に従ってください。

アップロードサイズの変更

  1. サーバーに接続します:
  • SSHを使用して、サーバーのコマンドラインインターフェースにアクセスします。
  1. 設定ファイルを編集します:
  • 設定ディレクトリに移動し、app.ymlファイルを編集します。
cd /var/discourse/
nano containers/app.yml
  1. アップロードパラメータを変更します:
  • paramsとラベル付けされたセクションを探します。そのすぐ下に、フォーマットに細心の注意を払って、目的のアップロードサイズを追加します。
params:
  ## このコンテナが使用するGitリビジョンはどれですか? (デフォルト: latest)
  version: latest
  ## 最大アップロードサイズ (デフォルト: 10m)
  upload_size: 20m
  1. 変更を保存します:
  • Ctrl+Xを押して終了し、Yを押して確認し、Enterを押して変更を保存します。
  1. Discourseインスタンスを再構築します:
  • /var/discourseディレクトリから次のコマンドを実行します。
./launcher rebuild app
  1. サイト設定を更新します:
  • Discourseダッシュボードで/admin/site_settings/category/filesに移動します。
  • max attachment size kbmax image size kbをお好みのサイズ(例: 20 MB)に調整します。設定UIでは、値を入力し、ドロップダウンから単位(KB、MB、またはGB)を選択できます。

:exclamation: 両方の設定は、ステップ3で設定したupload_sizeパラメーターによって制御されるnginxのclient_max_body_size値によって制限されます。サイト設定はこの制限を超えることはできません。

「いいね!」 62
Can't Increase the Max File Size
What is the max image upload size limit by file type
Struggling to find correct instructions to increase file upload limit
Image upload size/resize question
Upload Large Video
Can't Increase the Max File Size
What is the maximum file size we can upload on discourse?
Rebuild of Discourse fails due to spaces in YAML file
With Uploads -- That page doesn’t exist or is private
Image upload error when using resizer
:cn: Change the max size of uploads/attachments | Discourse 修改上传附件的大小
Category image upload stops at 0%
Attachments max size limit in self and business hosting difference
Do I need to install NGINX and PHP to optimize my Discourse forum?
Remove Dropbox Onebox For Audio Links
Issue with maximum upload file size
Uploads involving client-side JS preprocessing fail in Chrome based browsers
“Image larger than 4mb” error when posting a gif
Inquiry About Discourse’s Support for Amazon S3 Storage
Maxmum upload size
Meta Data From Image Upload
Set file size upload to 17 megs, unable to upload 12.2 meg file
NGinx.conf File location
Multipart upload
Can Discourse accept attachments when using emails to create new category topics?
What is the maximum file size we can upload on discourse?
Problem about attachment file size
Max upload size error
Why is my upload limit 100mb?It's set to 500mb
Issue with maximum upload file size
Increasing max file size
How to change upload limit by command line
Attachments: Oops! That page doesn’t exist or is private
Increase the file size of attachment
Sorry, that file is too big V2
Raising max file upload limit in configs
Allow log file for topic and restricted to admin