move file ext check to php controller