SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have this requirement, using WSS 3.0, that when an attachment is added or deleted from a list item, I need to send an email to the users. I'm not having a problem with the emails; it's understanding how the following events work. I'm using the following 4 events:

ItemAttachmentAdding, ItemAttachmentAdded, ItemAttachmentDeleting, ItemAttachmnetDeleted

If I add 2 attachments to an item, I get ItemAttachmentAdding and ItemAttachmentAdded fired for each attachment, which is what I expect. But when I delete 2 attachments, I get ItemAttachmentDeleting and ItemAttachmentDeleted fired only once total (for both files). I expect this to behave like the Adding/Added events; both events for each file deleted. And unlike the Adding/Added events, I don't have access to the name of the attachments that were deleted. Seems inconsistent.

Is this the correct behavior for these events? And is there a way to identify the names of the attachments that were deleted?

share|improve this question

I've quickly checked on 2010 version - there's the SPItemEventProperties.BeforeUrl property (and corresponding SPItemEventProperties.AfterUrl property). On ItemAttachmentDeleting event SPItemEventProperties.BeforeUrl contains the url of the targeted attachment. I hope it works similar in 2007 version.

Unfortunately in the 2010 version ItemAttachmentDeleting event is being fired once for each attachment.

share|improve this answer
Thank you Alex. On the AttachmentDelete/Deleting events, I'm seeing BeforeUrl as null. On the AttachmentAdded/Adding events, BeforeUrl does contain the filename. Either 3.0 is screwed up or it's me. I'm glad to see it works in 2010 as I would expect it to. Unfortunately, I'm stuck in 3.0 for awhile so I'll have to come up with some sort of work around. – DrZ Feb 21 '12 at 13:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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