Quick code I made for filtering out extensions for my C# Uploader I'm making.
ExamplePHP Code:
static Boolean Evaluate_Extension(String Extension)
{
String[] Block = new String[] {".exe", ".html", ".php" };
if (Block.Contains(Extension))
{
return false;
}
return true;
}
PHP Code:
if(Evaluate_Extension(Path.GetExtension(@"C:\Users\Chad\Desktop\test.txt")) == true){
Console.WriteLine("Continue with process...");
}else{
Console.WriteLine("Inappropriate file!");
}