Update: 4/2/2016 to enable .JPG validation .
There's a pretty popular hex Arc package that might work for you. Extracted from the arc:
def validate({file, _}) do
~w(.jpg .jpeg .gif .png .JPG) |> Enum.member?(Path.extname(file.file_name))
end
source
share