I\'ve searched all over the internet and the "safest" way to check uploaded file type seems to be checking magic numbers/headers using python-magic li
python-magic