mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
adds the max_attachment_size_kb setting
so that we can specify a different max upload size for attachments and images.
This commit is contained in:
@@ -4,7 +4,10 @@ class UploadsController < ApplicationController
|
||||
def create
|
||||
file = params[:file] || params[:files].first
|
||||
|
||||
return render status: 415, json: failed_json unless SiteSetting.authorized_file?(file)
|
||||
unless SiteSetting.authorized_upload?(file)
|
||||
text = I18n.t("upload.unauthorized", authorized_extensions: SiteSetting.authorized_extensions.gsub("|", ", "))
|
||||
return render status: 415, text: text
|
||||
end
|
||||
|
||||
upload = Upload.create_for(current_user.id, file)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user