Here is my scenario.
I would like to allow the only certain file types (doc,docx,pdf,ppt,pptx) into my document library. I wrote ItemAdding event receiver for document library as follows. but i am unable to prevent the uploading ? Can some one guide me..
{ checking the file type here. }
properties.Cancel = true;
//properties.Status = SPEventReceiverStatus.CancelWithError;
properties.ErrorMessage = "File extension not allowed here";
// properties.Status = SPEventReceiverStatus.CancelWithRedirectUrl;
SPUtility.TransferToErrorPage("Invalid File Type");
What i am doing wrong here... ?