Home > Blockchain >  How to create file validation in dapper?
How to create file validation in dapper?

Time:12-24

To create file validation in dapper,I was stuck about this.could anyone please help me to describe about this?

XmlReader reader = XmlReader.Create(schema "\Students.xml", settings);
while (reader.Read()) ;
if (valid)
{
writertbox("Document SCHEMA is valid");
} // end if
valid = true;
reader.Close();

CodePudding user response:

Try the below code:

string extension =

Path.GetExtension (file.FileName);

if(extension != ".xlsx" || extension !=

".xls")

{

return BadRequest();

}

  • Related