Hello,
You can achieve your aim by amending the media file uploader control (in fact, you will need to have 2 different controls/webparts for that) to the page. It will upload selected file, and after that it will move it with another name. You would add following code just after the media file creation (around line 210):
// rename file
string newPath = null;
int slahIndex = mfi.FilePath.LastIndexOf('/');
if (slahIndex > 0)
{
newPath = mfi.FilePath.Remove(slahIndex) + "/newFileName.jpg";
}
else
{
newPath = "newFileName.jpg";
}
// move file under new name
MediaFileInfoProvider.MoveMediaFile(CMSContext.CurrentSiteName, LibraryID, mfi.FilePath, newPath, false);
Please note that the example above is only a draft how it could look like, you might need to add extension checking etc.
Best regards
Ondrej Vasil