Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Event Receiver with Single file Upload and Multiple File Upload - SharePoint 2010

$
0
0

Hi all,

I have this requirement in my current project: when a file is added to a document library on one site collection, move the file to a different site on different site collection. To achieve this, I have written an Event Receiver on the document library. Added my code to "Copy" the file to the destination site in ItemAdded() event, then "Delete" the file from source library in ItemUpdated() event. This is working perfectly fine when a single file is updated. But when Multiple File Upload option is used, ItemUpdated() event doesn't fire and as a result I am unable to delete files uploaded after they are copied over to the destination site. Copying works file in this case as well, only deletion isn't happening.

I had to put the delete code in ItemUpdated() event as I can not delete the file before Meta data extraction screen appears. If I put the delete code in ItemAdded() event, I get error that file has been deleted or modified by another user. 

Can anyone help me here? 

Thank you in advance!


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>