How to disallow uploading executable files using Ruby UploadedFile?

75 Views Asked by At

I'm using ActionDispatch::Http::UploadedFile.new with my Grape project to upload files.

I'm not using any gem like paperclip to the job and I want to validate the file type and not to allow executable files.

From the documentarians seems I can use #content_type to check out the content of the file.

Is there any simple way to do the validation and where can I find a list of executable extensions?

0

There are 0 best solutions below