Insert a file attachment control
If you insert a file attachment control onto your form, users can add file attachments when they fill out the form. File attachment controls are bound to fields.
Insert a file attachment control (automatically create the data source)
You can have Microsoft Office InfoPath 2003 automatically create the data source when you insert the file attachment control (as well as other controls). If you do this, InfoPath creates a field in the data source that is bound to the file attachment control.
- In design mode, place the insertion point where you want to insert the file attachment control.
- If the Controls task pane is not visible, click More Controls on the Insert menu.
- In the Controls task pane, select the Automatically create data source check box.
Note If the check box is unavailable, the form's design does not allow the data source to be automatically created. You must insert a file attachment control that is bound to an existing field or to a field that you create.
- Right-click the file attachment control, and then, on the shortcut menu, click File Attachment Properties.
- Under Validation and Rules on the Data tab, select the Allow the user to attach only the following file types check box, and then type the file extension for the file type in the box. For example, type .doc to prevent users from attaching anything other than Microsoft Office Word documents.
- Right-click the file attachment control, and then, on the shortcut menu, click File Attachment Properties.
- Under Binding on the Data tab, click Specify default file.
- Click Browse, and then, in the Attach File dialog box, select the file that you want to appear inside the file attachment box on the form.
Insert a file attachment control (bind to an existing field)
- In design mode, place the insertion point where you want to insert the file attachment control.
Note If you are binding the file attachment control to a repeating field, the control must be inside a repeating control, such as a repeating section.
- If the Data Source task pane is not visible, click Data Source on the View menu.
- In the Data Source task pane, right-click the field that you want the file attachment control to be bound to, and then click File Attachment on the shortcut menu.
Note If you do not see File Attachment as a choice on the shortcut menu, make sure that the field has a picture or file attachment data type.
- By default, users can attach any type of file to their form, except files such as .exe files, which InfoPath blocks for security reasons. You can choose to limit the types of files that users can attach to their forms.
- Right-click the file attachment control, and then, on the shortcut menu, click File Attachment Properties.
- Under Validation and Rules on the Data tab, select the Allow the user to attach only the following file types check box, and then type the file extension for the file type in the box. For example, type .doc to prevent users from attaching anything other than Microsoft Office Word documents.
- By default, a file attachment control with placeholder text is inserted onto the form.
You can make a default file appear on the form instead of the placeholder text.
- Right-click the file attachment control, and then, on the shortcut menu, click File Attachment Properties.
- Under Binding on the Data tab, click Specify default file.
- Click Browse, and then, in the Attach File dialog box, select the file that you want to appear inside the file attachment box on the form.
Notes
- InfoPath blocks users from attaching potentially unsafe files (such as .bat, .exe, .vbs, and .js files) that may contain viruses.
- The information in this topic may not apply if you are working with a form designed using Microsoft Office InfoPath 2003 without the service pack installed. Learn more