Yet the two suggestions in the article are insufficient..
and the one about limiting file names is great where the programmer can control it, what happens when the files are named by another party like the IRS? The DOD? What about embedded paths in whatever they are uploading?
Sanitize what you can, but if you are letting users upload files, there will probably always be an edge case that can escape whatever sandbox you build.
Much like anything with dates and time, if you think you have it covered with a couple simple lines, you are wrong and need to step aside and let someone else fix it with a 3rd party library. Preferably one that is at least a decade old, and was updated in the last week. And yes there are libraries for checking paths, and yes people still keep trying to do it themselves. (see the recent Reg on batch files).