mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
support arbitrary attachments
This commit is contained in:
@ -4,8 +4,7 @@ class UploadsController < ApplicationController
|
||||
def create
|
||||
file = params[:file] || params[:files].first
|
||||
|
||||
# only supports images for now
|
||||
return render status: 415, json: failed_json unless file.content_type =~ /^image\/.+/
|
||||
return render status: 415, json: failed_json unless SiteSetting.authorized_file?(file)
|
||||
|
||||
upload = Upload.create_for(current_user.id, file)
|
||||
|
||||
|
Reference in New Issue
Block a user