From 41c1193a783d72e1ee247fea6fdfc849722db568 Mon Sep 17 00:00:00 2001 From: Zanz2 Date: Thu, 16 Nov 2017 01:34:38 +0100 Subject: [PATCH 1/2] Fixed unit error;Now when comparing file size, both are in bytes --- app/controllers/protocols_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/protocols_controller.rb b/app/controllers/protocols_controller.rb index 4fa57881c..d33630a94 100644 --- a/app/controllers/protocols_controller.rb +++ b/app/controllers/protocols_controller.rb @@ -610,7 +610,7 @@ class ProtocolsController < ApplicationController end return 0 # return 0 stops the rest of the controller code from executing end - if file_size / 1000 > Constants::FILE_MAX_SIZE_MB + if file_size > Constants::FILE_MAX_SIZE_MB * 1000000 @protocolsio_too_big = true respond_to do |format| format.js {} From 1b540a75a1edb3ed45c69057d2e81cdf3ab81376 Mon Sep 17 00:00:00 2001 From: Zanz2 Date: Thu, 16 Nov 2017 15:17:13 +0100 Subject: [PATCH 2/2] Fixed to use .megabytes --- app/controllers/protocols_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/protocols_controller.rb b/app/controllers/protocols_controller.rb index d33630a94..581b83e13 100644 --- a/app/controllers/protocols_controller.rb +++ b/app/controllers/protocols_controller.rb @@ -610,7 +610,7 @@ class ProtocolsController < ApplicationController end return 0 # return 0 stops the rest of the controller code from executing end - if file_size > Constants::FILE_MAX_SIZE_MB * 1000000 + if file_size > Constants::FILE_MAX_SIZE_MB.megabytes @protocolsio_too_big = true respond_to do |format| format.js {}