def file_extension(filename)
      ext = File.extname(filename).gsub('.','').downcase if filename
      # for remote files which has asset id after extension
      ext.split('?')[0]
    end
def file_extension(filename)
      ext = File.extname(filename).gsub('.','').downcase if filename
      # for remote files which has asset id after extension
      ext.split('?')[0]
    end
@param [String, File] filename   The full filename, or path

 @return [String] The file extension