I currently have a form that lets people upload files.
I would like the file to be renamed to their username once it is uploaded. The best I can get it is to keep the original filename. Now I can do a
exec("cp $file /path/to/file/$file_name");
but the problem is that when I do it like
exec("cp $file /path/to/file/$username");
it loses the file extension... Is there a way around this to rename it and then save it?