Skip to content

User Rate Limits

User rate limits ควบคุมว่า regular users หรือ visitors จะ upload files จาก homepage ได้ถี่แค่ไหน ช่วยลดการ abuse ของ public upload pages

Feature นี้มีผลเฉพาะ homepage uploads Admin uploads และ uploads ที่ทำด้วย API Tokens จะไม่ถูกจำกัดโดย user rate limits

ตั้งค่าที่ไหน

เปิด admin panel แล้วไปที่:

text
System Settings -> Security Settings -> Upload Management -> User Rate Limits

User rate limit settings

Enable Rate Limits

หลังเปิด Enable Rate Limits ImgBed จะ track recent uploads ตาม uploader IP address

Default values:

SettingDefaultDescription
Detection window1.5 hoursนับ upload records ย้อนหลังนานแค่ไหน
Max file count20จำนวน files สูงสุดที่ allowed ใน detection window
Single file size limit20 MBขนาดสูงสุดของ file เดียว
Total upload size limit200 MBTotal upload size สูงสุดใน detection window

ตัวอย่าง ถ้าตั้ง 1.5 hour window, 20 files, 20 MB ต่อ file และ 200 MB total uploads จาก IP เดียวกันจะถูก block เมื่อเกิน limit ใด limit หนึ่ง

Excluding File Types

Excluded upload file types block regular users หรือ visitors ไม่ให้ upload file categories ที่เลือก

Available categories:

TypeDescription
Imagesjpg, png, webp, gif และ image files ใกล้เคียง
Videosmp4, webm, mov และ video files ใกล้เคียง
Audiomp3, flac, wav และ audio files ใกล้เคียง
Documentspdf, txt, md, docx และ document files ใกล้เคียง
OtherFiles นอก categories ด้านบน เช่น zip, rar, exe, apk

ค่าเริ่มต้นคือไม่มี type ถูกเลือก แปลว่า allowed

เมื่อคลิก type จะ highlight ซึ่งหมายถึง type นั้นถูก block

ถ้าเลือก Other visitors ที่ upload zip หรือ rar files จะถูก block และเห็นข้อความว่า file type นี้ไม่ supported

Block Messages

เมื่อ limit ถูก trigger users จะเห็น message ที่ตรงกับสถานการณ์:

Too frequent upload message

ScenarioMessage Meaning
Single file too largeFile ใหญ่เกินไป ควร compress ก่อน upload
File type blockedFile type นี้ไม่ supported ให้เอาออกแล้วลองใหม่
Uploads too frequentRecent uploads ถี่เกินไป พร้อมแสดง retry time
Total size too highRecent total upload size สูงเกินไป พร้อมแสดง retry time

ควร Enable เมื่อไร

Enable user rate limits ถ้า upload homepage เปิดให้ public เข้าถึงได้

เหตุผลที่พบบ่อย:

  • กังวล scripted bulk uploads
  • ต้องการจำกัด large visitor uploads
  • ต้องการให้ regular users upload ได้เฉพาะ images ไม่ใช่ archives หรือ installers
  • ต้องการให้ public upload ยังใช้งานได้ แต่ควบคุม resource usage

ถ้า site ใช้เองเท่านั้น หรือมีเฉพาะ administrators ที่ upload ได้ สามารถปิดไว้ได้

Released as user documentation for CloudFlare ImgBed.