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 #237 from birdage/ext_attachment_fix

fixes jira issue 1603