Well I've not programmed in PHP but have worked in VB and we setup an FTP program that assigned a unique number to files so the user would never know the real file name so they could not manually download the file and there were over 5 million files and none of them were an issue with same file name even though users could upload/download files.

Can't say I've ever been on a system that handled files this way (not saying there are not other apps out there that don't, but none that come to mind).

I see it as a very easy task using MySQL and auto generated unique keys. Add a file it gives it a unique name, but also stores what the 'REAL' name is and even if it has to do a temporary file rename or something it then gives the user back the file with the REAL name.