File: added extension whitelist check for files to prevent dangerous files from being uploaded.

Whitelist is checked on file creations.