ASP.NET File Upload Progress - Knowledge Base

« Back to Knowledge Base list

Add allowed extensions of files to upload in server-side.

Q:

Can the allowed extensions be picked up from .config file so that they can remain dynamic?

A:

You can add allowed files extensions and sizes dynamically in server-side.
Example:

OboutInc.FileUpload.Format allowedFormat;

allowedFormat = new OboutInc.FileUpload.Format();
allowedFormat.Ext = "doc";
allowedFormat.MaxByteSize = 10000;

FileUploadProgressControl.AllowedFileFormats.Add(allowedFormat);


Where "FileUploadProgressControl" is ID of the FileUplowedProgress control.

You can pick allowed files extensions and sizes from any file.