Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Accept / Reject File Upload Depending Upon XML Schema Validation

Uploading files from the client machine onto the server is a fairly common task in web applications. Recently I came across such an application where the end users are required to upload XML files from their machine onto the server. These XML files were produced as a result of some export operation of a desktop application installed on their machines. These XML files then used to get imported in some central database for further processing.  Uploading the file is a quite straightforward thing but in this case it was also required to validate these uploaded files against an XML schema (XSD). This was a safeguard against manual or accidental tampering of the files that might take place at the end user's side. If a file is found to be invalid the it shouldn't be accepted in the system for obvious reason. This article discusses a simple solution to accomplish this task.

http://www.binaryintellect.net/articles/9394ddb6-bc16-4da3-a5f8-d9dbcd775f50.aspx