I need to upload a file into a SharePoint 2010 document library that will go through some validation. I plan to use the MS Office Open XML SDK to open Excel and read values from cells.
I can think of three approaches to do this, and I would like to know if anyone has attempted this before?
Please note that I can use Visual Studio 2010, but not any third party workflow products such as K2/Nintex.
Aim:
To load an Excel file into a SharePoint list with custom .NET validation against an external database.
Approach 1: Event Receiver
Step 1: User loads Excel into SharePoint Document Library
Step 2: Event receiver calls external web services in .NET in order to validate the file
Step 3: File is accepted
Step 4: File is rejected with detailed message for the user
Advantage: Least amount of custom coding
Approach 2: Custom WebPart
Step 1: User loads Excel File through Custom Web Part
Step 2: Custom Web Part calls external web services in .NET in order to validate the file
Step 3: File is accepted, Custom Web Part will insert file into SharePoint Document Library
Step 4: File is rejected, error dialog presented to user
Advantage: More control of user experience
Advantage: SharePoint not involved until file has been validated
Disadvantage: Most amount of custom coding
Approach 3: Custom WorkFlow
Step 1: User loads Excel into SharePoint Document Library
Step 2: Custom Workflow is called, calls external web services in .NET in order to validate the file
Step 3: File is accepted
Step 4.1: File is rejected and removed from library
Step 4.2: Email sent to user with error message
Disadvantage: No real time feedback on validation