diff --git a/lib/rails_admin/config/fields/types/file_upload.rb b/lib/rails_admin/config/fields/types/file_upload.rb index b3ffe52e9a..1199c29041 100644 --- a/lib/rails_admin/config/fields/types/file_upload.rb +++ b/lib/rails_admin/config/fields/types/file_upload.rb @@ -52,7 +52,7 @@ class FileUpload < RailsAdmin::Config::Fields::Base end register_instance_option :image? do - mime_type = Mime::Type.lookup_by_extension(resource_url.to_s.split('.').last) + mime_type = Mime::Type.lookup_by_extension(resource_url.to_s.split('.').last&.split('?')&.first) mime_type.to_s.match?(/^image/) end