I'm interested making certain my file uploaded via php into a db is locked down. Currently the key functions I'm using are fopen and fgetcsv. Unfortunately this subject seems quite nebulous in the webs.
The file isn't "executed" but is opened and walked with fgetcsv. What steps do I need to do in order make certain that no foul play occurs on my server through this module?
Currently I limit the file size and check the extension.
- Do I need to verify the file uploaded is actually a csv and not just some file with a csv extension? I assume this would be through a file type recognizer?
- What do I need to do to avoid multibyte/encoding exploits?
***Edit I found this link to be helpful and may be to others; http://php.net/manual/en/features.file-upload.post-method.php
Thanks