added additional param to indicate what file types can be uploaded.
added file type check for uploaded documents