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 »

 
 Subscribe via RSS or Email

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 of S.Y.M. Wong-A-Ton. 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, S.Y.M. Wong-A-Ton.

InfoPath 2013 Cookbook: 121 Codeless Recipes for Beginners
InfoPath 2013 Cookbook 2: 121 Codeless Recipes for SharePoint 2013
InfoPath 2010 Cookbook: 101 Codeless Recipes for Beginners
InfoPath 2010 Cookbook 2: 101 Codeless Recipes for SharePoint 2010
InfoPath 2010 Cookbook 3: 101 Code Recipes for C# Developers
InfoPath 2010 Cookbook 5: Integrating InfoPath with Excel and Excel Services


Related Posts

InfoPath 2013 Cookbook: 121 Codeless Recipes for Beginners

InfoPath 2013 Cookbook 2: 121 Codeless Recipes for SharePoint 2013

InfoPath 2010 Cookbook: 101 Codeless Recipes for Beginners

InfoPath 2010 Cookbook 2: 101 Codeless Recipes for SharePoint 2010

InfoPath 2010 Cookbook 3: 101 Code Recipes for C# Developers

InfoPath 2010 Cookbook 4: 101 Code Recipes for VB Developers

InfoPath 2010 Cookbook 5: Integrating InfoPath with Excel and Excel Services