determine file type using magic
