Windows SharePoint Services Products and Technologies blog by Harish Mathanan

Tuesday, May 12, 2009

InfoPath File Attachment control and File Not Found error.

InfoPath forms have a default control for attaching/uploading files, called File Attachment. You can find it on the Design Tasks pane (View –> Design Tasks), under Controls within the File and Picture section. You can easily drag and drop the control unto your form in design mode.

file01

InfoPath team blog has a post on this, which also explains the blocked file types (such as exe and bat).

Additional:

If you ever get a “File not found” error attaching or uploading files there is a wonderful post here by SaurabhKV. I resolved this issue by adding a tiny bit of JavaScript (see below) as per-SaurabhKV’s post into a hidden CEWP at the bottom of the page in where the form resides. Hope this helps.

<script type="text/javascript">
aspnetForm.encoding = "multipart/form-data";
</script>

1 comments:

Ben said...

Javascript snippet worked perfectly, thanks.

 
Copyright Harish Mathanan 2008