Need Allow Users Attach Only Permissable File Types - InfoPath Dev
in

InfoPath Dev

Need Allow Users Attach Only Permissable File Types

Last post 05-24-2012 10:32 AM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 05-23-2012 05:24 PM

    Need Allow Users Attach Only Permissable File Types

    First, I am new to InfoPath 2007 and self-teaching so pardon my inability to explain myself like a pro.

    I want to enable an attach file control but only if another field contains a file name with one of three possible extension: .xls, .xlsx or .txt; otherwise I want attach file disabled.

    Thanks for the help. 

  • 05-23-2012 06:47 PM In reply to

    Re: Need Allow Users Attach Only Permissable File Types

    Hmmm.

    If you are using a filler form (i.e., your form is not going to be used in the browser), you can restrict the file types on the file attachment control itself - that will be under properties.

    Since we can't set conditional formatting on a file control - I'd actually put it in a section, and then hide it. To hide it, I'd use conditional formatting with a custom pattern.

    So, for the first drop down in your conditional formatting, select the field that has the file name. For the middle drop down, select "does not match pattern". For the third, select custom pattern. The custom pattern would be:
    .*(\.xls|\.xlsx|\.txt)

    I've attached a simple sample form - save it locally, and right click the saved file to open in design mode. From there, you can preview.

     

    Hilary Stoupa

  • 05-24-2012 10:10 AM In reply to

    Re: Need Allow Users Attach Only Permissable File Types

    Thank you for the help. Reading your reply I realize I left out some key information: 1) Am using InfoPath 2007, 2) Am going to publish my form to an internal SharePoint document library, 3) Am using both a field for the user to enter the name of the file they are attaching and 4) Have done as you say and restricted allowable file type in the attachment control to .xls, .xlsx and .txt.

    I decided that it would be good to also enforce these file extensions in the file name field and came very close to guessing at what you provided but not quite. I appreciate your clearing that cloud. By the way I downloaded your sample file but was unable to open it. I entered my infopathdev user name and password but was rejected. Is there another way or another set of credentials I need to get at your file? I got it to work. Thanks again. I have another question but will create another post as I suppose that is the correct protocol in these sites.

  • 05-24-2012 10:32 AM In reply to

    Re: Need Allow Users Attach Only Permissable File Types

    You'll download the file and then have to open it in design mode - IP forms HATE to be moved. So save the file locally, then right click it, and select Design. That opens it in design mode...

    And yes, new post for a question on another topic is usually what folks do here...

    Hilary Stoupa

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.