Welcome to WebmasterWorld Guest from 22.214.171.124
you cannot change the name of a file before you upload it.
when you upload a file the script must create a file and write the uploaded data to the file.
you can name the newly created file anything you like when you create it...
The function that you wrote would help me if I'd like to change the name of the first image.
if yes rename it and upload
Are you trying to name the existing file, if there the new file is having the same file name as the one already in the server?