Thursday, October 15, 2009

detect if new spfile is uploaded

Hi

Is there a way to detect if
a new spfile is uploaded in document library/ old spfile is replaced for the same item
or
only the meta data have been edited. (may be in itemupdated eventhandler.)




Thanks & Regards
Hemant Kumar
EMAIL REMOVED

Reply 1

When a file is replaced, the ItemUpdated event is triggered.  The same is true if you just change the metadata for the file.  Not sure if it's relevant to you, but replacing an existing file does not call ItemDeleted and ItemAdded.  In other words, it's not a delete and add operation.




Randy - http://sharepointhawaii.com/randywilliams

Reply 2

Hi,

Yes, as Williams’s information, both file replacing action and metadata updating action trigger ItemUpdated event.

And perhaps you need to distinguish them by BeforeProperties and AfterProperties.

Here is a  Williams article for detailed information when retrieving event’s  before and after value.

Hope this can help.

 

Best Regards,

-Aaron

Reply 3

Hi,

@hemantrhtk :) Please look at this link :http://www.synergyonline.com/blog/blog-moss/Lists/Posts/Post.aspx?ID=25
A great artcile for eventhandler.

Best Regards,

-Aaron

Reply 4

Hello Aron

Could you suggest , possibly what is is the column /property name which changes while new doc is uploaded/previous doc is overridden.

I tried the same thing before starting this thread with all the properties in loop , but could not figure out the possible column/property name.

Cheers-Hemant

No comments:

Post a Comment