Directly use UploadedFile object if available.
Opera doesn't support XHR file uploads and instead submits a regular form. Thus, we are provided with an UploadedFile object which can be used instead of creating our own compatible object.
This commit is contained in:
parent
8a44b384c0
commit
5f906defc8
1 changed files with 5 additions and 1 deletions
|
|
@ -49,7 +49,11 @@ class PhotosController < ApplicationController
|
||||||
params[:photo][:aspect_ids] = params[:photo][:aspect_ids].values
|
params[:photo][:aspect_ids] = params[:photo][:aspect_ids].values
|
||||||
end
|
end
|
||||||
|
|
||||||
params[:photo][:user_file] = file_handler(params)
|
params[:photo][:user_file] = if request.params.has_key?(:qqfile) and not request.params[:qqfile].is_a?(String)
|
||||||
|
params[:qqfile]
|
||||||
|
else
|
||||||
|
file_handler(params)
|
||||||
|
end
|
||||||
|
|
||||||
@photo = current_user.build_post(:photo, params[:photo])
|
@photo = current_user.build_post(:photo, params[:photo])
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue