I need to rename an uploaded document by adding some additional information to its file name, currently I do this with an Event Receiver ItemAdded
wiring up on Document Library, using code
SPListItem material = properties.ListItem;
material["Name"] = RenameFile(material["Name"].ToString());
material.Update();
//material.UpdateOverwriteVersion(); //same issue
This would works fine until the same file is uploaded again, after renaming the error "the specified name is already in use"
will occur although I have enabled document version control.
Do I need to create a new version programmatically? if so, how am I supposed to do it, can someone shed some lights on this? Any help is deeply appreciated.