fixes jira issue 1603
added file ext name check as well as checking file for pre-existing file ext in the filename
Merge pull request #238 from birdage/ext_attachment_fix-r2

fixes jira issue 1603