I’m working on the file upload portion of a Rails app. Different types of files are handled differently by the app.
I want to make a whitelist of certain file extensions to check the uploaded files against to see where they should go. All of the file names are strings.
I need a way to check only the extension part of the file name string. The file names are all in the format of “some_file_name.some_extension”.
1 Answer