Exemple #1
0
 private void DefaultSettings()
 {
     this.Enabled               = false;
     this.UserFilesPath         = "/userfiles/";
     this.UserFilesAbsolutePath = "";
     this.ForceSingleExtension  = true;
     this.AllowedTypes          = new string[] { "File", "Image", "Flash", "Media" };
     this.HtmlExtensions        = new string[] { "html", "htm", "xml", "xsd", "txt", "js" };
     this.TypeConfig            = new TypeConfigList((FileWorkerBase)this.Page);
     this.TypeConfig["File"].AllowedExtensions = new string[] {
         "7z", "aiff", "asf", "avi", "bmp", "csv", "doc", "fla", "flv", "gif", "gz", "gzip", "jpeg", "jpg", "mid", "mov",
         "mp3", "mp4", "mpc", "mpeg", "mpg", "ods", "odt", "pdf", "png", "ppt", "pxd", "qt", "ram", "rar", "rm", "rmi",
         "rmvb", "rtf", "sdc", "sitd", "swf", "sxc", "sxw", "tar", "tgz", "tif", "tiff", "txt", "vsd", "wav", "wma", "wmv",
         "xls", "xml", "zip"
     };
     this.TypeConfig["File"].DeniedExtensions         = new string[0];
     this.TypeConfig["File"].FilesPath                = "%UserFilesPath%file/";
     this.TypeConfig["File"].FilesAbsolutePath        = (this.UserFilesAbsolutePath == "") ? "" : "%UserFilesAbsolutePath%file/";
     this.TypeConfig["File"].QuickUploadPath          = "%UserFilesPath%";
     this.TypeConfig["File"].QuickUploadAbsolutePath  = "%UserFilesAbsolutePath%";
     this.TypeConfig["Image"].AllowedExtensions       = new string[] { "bmp", "gif", "jpeg", "jpg", "png" };
     this.TypeConfig["Image"].DeniedExtensions        = new string[0];
     this.TypeConfig["Image"].FilesPath               = "%UserFilesPath%image/";
     this.TypeConfig["Image"].FilesAbsolutePath       = (this.UserFilesAbsolutePath == "") ? "" : "%UserFilesAbsolutePath%image/";
     this.TypeConfig["Image"].QuickUploadPath         = "%UserFilesPath%";
     this.TypeConfig["Image"].QuickUploadAbsolutePath = "%UserFilesAbsolutePath%";
     this.TypeConfig["Flash"].AllowedExtensions       = new string[] { "swf", "flv" };
     this.TypeConfig["Flash"].DeniedExtensions        = new string[0];
     this.TypeConfig["Flash"].FilesPath               = "%UserFilesPath%flash/";
     this.TypeConfig["Flash"].FilesAbsolutePath       = (this.UserFilesAbsolutePath == "") ? "" : "%UserFilesAbsolutePath%flash/";
     this.TypeConfig["Flash"].QuickUploadPath         = "%UserFilesPath%";
     this.TypeConfig["Flash"].QuickUploadAbsolutePath = "%UserFilesAbsolutePath%";
     this.TypeConfig["Media"].AllowedExtensions       = new string[] {
         "aiff", "asf", "avi", "bmp", "fla", "flv", "gif", "jpeg", "jpg", "mid", "mov", "mp3", "mp4", "mpc", "mpeg", "mpg",
         "png", "qt", "ram", "rm", "rmi", "rmvb", "swf", "tif", "tiff", "wav", "wma", "wmv"
     };
     this.TypeConfig["Media"].DeniedExtensions        = new string[0];
     this.TypeConfig["Media"].FilesPath               = "%UserFilesPath%media/";
     this.TypeConfig["Media"].FilesAbsolutePath       = (this.UserFilesAbsolutePath == "") ? "" : "%UserFilesAbsolutePath%media/";
     this.TypeConfig["Media"].QuickUploadPath         = "%UserFilesPath%";
     this.TypeConfig["Media"].QuickUploadAbsolutePath = "%UserFilesAbsolutePath%";
 }
Exemple #2
0
		private void DefaultSettings() 
		{
			// Initialize all default settings.

			Enabled = false;
			UserFilesPath = "/userfiles/";
			UserFilesAbsolutePath = "";
			ForceSingleExtension = true;
			AllowedTypes = new string[] { "File", "Image", "Flash", "Media" };
			HtmlExtensions = new string[] { "html", "htm", "xml", "xsd", "txt", "js" };

			TypeConfig = new TypeConfigList( (FileWorkerBase)this.Page );

			TypeConfig[ "File" ].AllowedExtensions = new string[] { "7z", "aiff", "asf", "avi", "bmp", "csv", "doc", "fla", "flv", "gif", "gz", "gzip", "jpeg", "jpg", "mid", "mov", "mp3", "mp4", "mpc", "mpeg", "mpg", "ods", "odt", "pdf", "png", "ppt", "pxd", "qt", "ram", "rar", "rm", "rmi", "rmvb", "rtf", "sdc", "sitd", "swf", "sxc", "sxw", "tar", "tgz", "tif", "tiff", "txt", "vsd", "wav", "wma", "wmv", "xls", "xml", "zip" };
			TypeConfig[ "File" ].DeniedExtensions = new string[] { };
			TypeConfig[ "File" ].FilesPath = "%UserFilesPath%file/";
			TypeConfig[ "File" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%file/" );
			TypeConfig[ "File" ].QuickUploadPath = "%UserFilesPath%";
			TypeConfig[ "File" ].QuickUploadAbsolutePath = "%UserFilesAbsolutePath%";

			TypeConfig[ "Image" ].AllowedExtensions = new string[] { "bmp", "gif", "jpeg", "jpg", "png" };
			TypeConfig[ "Image" ].DeniedExtensions = new string[] { };
			TypeConfig[ "Image" ].FilesPath = "%UserFilesPath%image/";
			TypeConfig[ "Image" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%image/" );
			TypeConfig[ "Image" ].QuickUploadPath = "%UserFilesPath%";
			TypeConfig[ "Image" ].QuickUploadAbsolutePath = "%UserFilesAbsolutePath%";

			TypeConfig[ "Flash" ].AllowedExtensions = new string[] { "swf", "flv" };
			TypeConfig[ "Flash" ].DeniedExtensions = new string[] { };
			TypeConfig[ "Flash" ].FilesPath = "%UserFilesPath%flash/";
			TypeConfig[ "Flash" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%flash/" );
			TypeConfig[ "Flash" ].QuickUploadPath = "%UserFilesPath%";
			TypeConfig[ "Flash" ].QuickUploadAbsolutePath = "%UserFilesAbsolutePath%";

			TypeConfig[ "Media" ].AllowedExtensions = new string[] { "aiff", "asf", "avi", "bmp", "fla", "flv", "gif", "jpeg", "jpg", "mid", "mov", "mp3", "mp4", "mpc", "mpeg", "mpg", "png", "qt", "ram", "rm", "rmi", "rmvb", "swf", "tif", "tiff", "wav", "wma", "wmv" };
			TypeConfig[ "Media" ].DeniedExtensions = new string[] { };
			TypeConfig[ "Media" ].FilesPath = "%UserFilesPath%media/";
			TypeConfig[ "Media" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%media/" );
			TypeConfig[ "Media" ].QuickUploadPath = "%UserFilesPath%";
			TypeConfig[ "Media" ].QuickUploadAbsolutePath = "%UserFilesAbsolutePath%";
		}