InfoPath Video Tutorial: Programmatically restrict file types in InfoPath browser forms
In this InfoPath video tutorial you'll learn how to write code in the Validating event of a File Attachment control to limit its allowable file types to one or more extensions.
The setting of allowable file types is not supported in browser forms. Therefore, if you want to prevent users from uploading files that are of a specific type, you’ll have to write code in the Validating event of a File Attachment control to do so.
In this InfoPath video tutorial, you learned…
- How to add a File Attachment control to a Repeating Table on an InfoPath form template.
- How to add a Validating event to a File Attachment control.
- How to write code that prevents the user from uploading files with file types that are not allowed.
For more information, also see How to encode and decode a file attachment programmatically by using Visual C# in InfoPath on the Microsoft Support web site.
See more InfoPath 2007 tutorial videos »
Copyright: This article may not be used on web sites (whether personal or otherwise), copied, disseminated, altered, printed, published, broadcasted, or reproduced in any way without an expressed written consent. The techniques demonstrated in this article may be used within any Microsoft InfoPath project. This article is provided without any warranties. Copyright for this article is non-transferrable and remains with the author.