no need to declare a 'ext' variable
use mime for filetype detection
moved symlink resolution to fileType function