Posted on: 5/14/2012 3:45:24 AM | Views : 258

  I have a C# web application. On a form a user is able to press a button of type System.Web.UI.WebControls.FileUpload. When this button is pressed, an upload dialog box is displayed allowing for upload. Is there a way to restrict the type of file being uploaded? For example, suppose that I only wanted to allow for uploading .txt and .xls files. How would I do that?
 Currently in the application if the application user tries to upload an zip file or .exe file, the application will crash. And of course, they shouldn't be trying to upload that data into the database anyway.
...

Go to the complete details ...