fixed handling of file extension when file is not coming from IPT