I plan to write a PHP script which will allow web users to upload MS Word formatted docs. Here are the precautions I am taking:
- Filenames will be created by me (something like
YYYY-MM-DD.doc
) - Files will have
600
or lower permissions. - Files will not be touched until they're downloaded via FTP.
- File size is limited.
I've been looking into ways to verify that a file is a valid word doc, but the strategies all seem flawed and very time consuming. Once they are downloaded to a computer for review, I let the computer's antivirus take over in case of a valid word doc that is somehow infected.
Does placing the files in a sort of quarantine, as outlined above, mitigate the dangers of not verifying that its word formatted?
http://www.example.com/uploads/2014-05-02.doc
).