Method: FormAPI::ApiClient#sanitize_filename

Defined in:
lib/form_api/api_client.rb

#sanitize_filename(filename) ⇒ String

Sanitize filename by removing path. e.g. ../../sun.gif becomes sun.gif

Parameters:

  • filename (String)

    the filename to be sanitized

Returns:

  • (String)

    the sanitized filename



277
278
279
# File 'lib/form_api/api_client.rb', line 277

def sanitize_filename(filename)
  filename.gsub(/.*[\/\\]/, '')
end