I have a PHP application.
I allow users to upload files to my web application.
Question: What\'s the best way for me to sanitize the file n
I bet that you also store some information about the file in the database. If this is correct, then you can use the primary key (ID) as a filename on your server and preserve the original filename in the database. This gives you greater flexibility, because you can manipulate the metadata without renaming the actual file.