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:
Régis Hanol
2013-07-16 01:59:23 +02:00
parent e83cd9d111
commit 5ce05ff5cb
19 changed files with 115 additions and 83 deletions

View File

@@ -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)