in general, the entire code of this function isn't very efficient.
- it iterates all files in the uploads directory looking for a file with the same base name... there could be thousands of files in that directory.
- also, the loop doesn't break when the file is found.
and in "more general", the entire code of arrowchat is really old and outdated. it might be a good idea to go open source and sell professional services.
take a look for example
http://red5.org/ as they have a basic free edition and a pro edition.
in exchange you'll get a lot of free updated and improvements to your code.
be glad to hear your thoughts about it.
10x!
Roey