add drag and drop file uploads w/async processing
[skip ci]
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
class UploadsController < ApplicationController
|
||||
before_action :member_only, except: [:index, :show]
|
||||
respond_to :html, :xml, :json, :js
|
||||
skip_before_action :verify_authenticity_token, only: [:preprocess]
|
||||
|
||||
def new
|
||||
@upload_notice_wiki = WikiPage.titled(Danbooru.config.upload_notice_wiki_page).first
|
||||
@upload, @post, @source, @normalized_url, @remote_size = UploadService::ControllerHelper.prepare(params[:url], params[:ref])
|
||||
@upload, @post, @source, @normalized_url, @remote_size = UploadService::ControllerHelper.prepare(
|
||||
url: params[:url], ref: params[:ref]
|
||||
)
|
||||
respond_with(@upload)
|
||||
end
|
||||
|
||||
@@ -39,6 +42,13 @@ class UploadsController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def preprocess
|
||||
@upload, @post, @source, @normalized_url, @remote_size = UploadService::ControllerHelper.prepare(
|
||||
url: params[:url], file: params[:file], ref: params[:ref]
|
||||
)
|
||||
render body: nil
|
||||
end
|
||||
|
||||
def create
|
||||
@service = UploadService.new(upload_params)
|
||||
@upload = @service.start!
|
||||
|
||||
Reference in New Issue
Block a user