forms.py updated to detect the file format automatically