There seems to be a few posts floating around that claim that this can be done without any coding and some hacking of the SharePoint GUI e.g. http://www.sharepointblogs.com/ervingayle/archive/2006/10/13/enabling-anonymous-users-to-open-and-submit-data-via-infopath-forms-published-to-sharepoint-2007.aspx
In my experience, and based on the number of disgruntled commenters on the above post- most people’s experience, this is just not true. Modifying a form library’s anonymous access settings page URL from DOCLIB to LISTS will not actually allow anonymous users to “contribute” to the library and successfully SUBMIT a form. The only way I can think of get the job done would be to put some code behind the form (or in a list event handler) that saves the form to the library while running under an admin account. Here is a blog outlining how to do this although I haven’t yet tried this myself.
Let me know if anyone gets this working as I would see this as a pretty common need.
Update: I did actually implement this solution myself but used the ViewSwitched event rather than the submit event as I was doing a few other things in there (like submit as email etc). My working code is below. I build up the form name using details from the form and store it in a hidden field called ‘name’.
public void FormEvents_ViewSwitched(object sender, ViewSwitchedEventArgs e)
XPathNavigator xPathNav = MainDataSource.CreateNavigator();
string name = xPathNav.SelectSingleNode(“/my:MessageSection/my:hiddenName”, NamespaceManager).InnerXml;
string url = “http://****/formlib/” + name + “.xml”;
//Convert underlying InfoPath XML to byte array’
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
byte Data = encoding.GetBytes(xPathNav.OuterXml);
//Create webclient, set credentials and upload data.’
System.Net.WebClient webclient = new System.Net.WebClient();
webclient.Credentials = new NetworkCredential(“****”, “****”, “****”);
webclient.UploadData(url, “PUT”, Data);
catch (Exception ex)