How to Securely Allow Users to Upload Files - Paragon Initiative Enterprises Blog
The theory and practice of securing file upload form handlers. Our examples are in PHP, but many of the filesystem security concepts here are language agnostic.
paragonie.com