Class: S3Multipart::UploadsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- S3Multipart::UploadsController
- Defined in:
- app/controllers/s3_multipart/uploads_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/s3_multipart/uploads_controller.rb', line 4 def create begin upload = Upload.create(params) upload.execute_callback(:begin, session) response = upload.to_json rescue FileTypeError, FileSizeError => e response = {error: e.} rescue response = {error: 'There was an error initiating the upload'} ensure render :json => response end end |
#update ⇒ Object
18 19 20 21 22 |
# File 'app/controllers/s3_multipart/uploads_controller.rb', line 18 def update return complete_upload if params[:parts] return sign_batch if params[:content_lengths] return sign_part if params[:content_length] end |