Couldn't your FTP server have handled this in a clever way? For example, sort in directories by first letter, then by first two letters. While still providing a virtual flat view to the FTP client user. It'd be a simple mapping away.
I don't. I am using stock vsftp with a PAM module that allows authentication against our web application.