<appSettings> <add key="FileSize" value="2097152"/> <add key="FileType" value=".txt,.xlsx,.xls,.docx,.doc,.ppt,.pptx,.pdf"/> </appSettings>
string[] allowExtentions = (ConfigurationManager.AppSettings["FileType"]).Split(','); if (allowExtentions.Contains(Path.GetExtension(FileUp.PostedFile.FileName)) || Path.GetExtension(FileUp.PostedFile.FileName) == "") { //custom code }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)