Added a check to allow only .txt files to be uploaded