Attachments in InfoPath Form that is a Task Workflow
Woho, here is a nice one :), one of the small things that gets you sometimes bang your head for long long time till you find out what's the problem...
Symptoms:
So if you are having a workflow that uses InfoPath forms for tasks and you have attachment controls in it, then you probably faced this error: "The Selected file was not found"!!
Solution or Workaround:
- Locate the ASPX page that your workflow form opens up in the _layouts directory on your server.
e.g., %Program Files%Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\
most probably you want WrkTaskIP.aspx --> this page is the one that loads your InfoPath form to be as a task form.
- in this aspx page, locate the reference to MasterPageFile. This will look something like
MasterPageFile="~/_layouts/application.master"
- Go to the masterPage file you found
In this case go to the application.master in the folder "%Program Files%Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\"
- Look for the Form Tag
<form runat="server" onsubmit="return _spFormOnSubmitWrapper();">
- Add the attribute enctype="multipart/form-data" to this tag and save.
<form runat="server" onsubmit="return _spFormOnSubmitWrapper();" enctype="multipart/form-data">
- iisreset and try your workflow with file attachment again.
Few things to Note:
as you can see, this is a product issue and hopefully it might be fixed in the SP1. But don't get frustrated, that's why we are blogging so you can find such information.
Have fun,,, :)
Comments
Anonymous
December 25, 2007
PingBack from http://geeklectures.info/2007/12/26/attachments-in-infopath-form-that-is-a-task-workflow/Anonymous
March 28, 2011
Hi Wael, How were you able to have the file attachment control on the infopath task form? I do not have that option in my form. I am using SharePoint 2010 and InfoPath 2010. Thanks!