تغيير الحد الأقصى لحجم المرفق/التحميل

:bookmark: يشرح هذا الدليل كيفية تغيير الحد الأقصى لحجم تحميل المرفقات لنسخ Discourse المستضافة ذاتيًا.

:person_raising_hand: مستوى المستخدم المطلوب: مسؤول النظام (System Admin)
الحد الافتراضي لحجم تحميل المرفقات هو 10 ميجابايت (10MB).

إذا كنت تستضيف Discourse ذاتيًا وتحتاج إلى السماح بتحميلات أكبر من 10 ميجابايت، فاتبع الخطوات أدناه.

تغيير حجم التحميل

  1. الاتصال بالخادم:
  • استخدم SSH للوصول إلى واجهة سطر الأوامر لخادمك.
  1. تعديل ملف التكوين:
  • انتقل إلى دليل التكوين وقم بتعديل الملف app.yml:
cd /var/discourse/
nano containers/app.yml
  1. تعديل معلمات التحميل:
  • ابحث عن القسم المسمى params. أسفله مباشرة، أضف حجم التحميل المطلوب مع إيلاء اهتمام دقيق للتنسيق:
params:
  ## Which Git revision should this container use? (default: latest)
  version: latest
  ## Maximum upload size (default: 10m)
  upload_size: 20m
  1. حفظ التغييرات:
  • اضغط على Ctrl+X للخروج، ثم Y للتأكيد، و Enter لحفظ التغييرات.
  1. إعادة بناء نسخة Discourse:
  • قم بتشغيل الأمر التالي من الدليل /var/discourse:
./launcher rebuild app
  1. تحديث إعدادات الموقع:
  • انتقل إلى /admin/site_settings/category/files في لوحة تحكم Discourse الخاصة بك.
  • اضبط max attachment size kb و max image size kb إلى الحجم المفضل لديك (على سبيل المثال 20 MB). يسمح لك واجهة المستخدم للإعداد بإدخال القيمة وتحديد وحدة (KB أو MB أو GB) من القائمة المنسدلة.

:exclamation: كلا الإعدادين مقيدان بقيمة client_max_body_size الخاصة بـ nginx، والتي يتم التحكم فيها بواسطة المعلمة upload_size التي قمت بتعيينها في الخطوة 3. لا يمكن لإعدادات الموقع تجاوز هذا الحد.

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