I must admit that I am totally unexperienced with developing anything to SP, but my problem sounds pretty simple - I need to manage some kind of regex command to rename any files uploaded to SP.

The situation is - user uploading filename containing illegal chars, spaces etc. I am able to handle the regex itself, but have no idea where to "add" it to SP.

Do I have to create "solution" or some kind of library made in MS Visual studio - overriding SP ItemReceiver event and changing the filename by regex? Aftewards load and enable it in SP? Is this the way how to do it? Can anyone share some howtos and study materials, just to push me on the way...

a) how to (and at which point) handle the filename & event b) how to modify SP source/libs and enable/install them

Thanks a lot for advice and my apologies for question that much stupid and noobish.

Cheers, Adam

1 Answer 1


check the below answers. will give you the idea how to achieve the target:

Change name in ItemAdding event receiver or create a new Item

also if you want to use WebDAV:


  • Thanks for your answer! It revealed a lot, although Ive ended up with situation that ItemAdding event receiver isnt firing. Its caused by ImportFederatedLocation.ValidateFile Method I guess, its causing error message and wont let me upload the file - and fire the regex in event receiver. Please help me, what am I doing wrong? Ive tried to "hack" the code of templates itself but it seems stupid to me, ... I have to remove illegal chars from filename before validation and upload. Thank you a lot! Apr 23, 2014 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.