A while ago I wrote a posting about how you can use a webpart to render an InfoPath form when using Forms Server in SharePoint Server 2007. I however noticed that when you add an attachment control to this form - it does not seem to work. When I took a closer look at the MSDN article - Hosting the InfoPath 2007 Form Editing Environment in a Custom Web Form - I noticed the next paragraph:
Note The encoding type (
enctype) attribute is necessary only if you intend to use the File Attachment control in a form loaded into the XmlFormView control. If this attribute is not set properly, the File Attachment control will appear to function but will not upload a file to the server running InfoPath Forms Services.
So you will need to add the next line to the CreateChildControls method:
tags: infopath2007, infopath, sharepoint, sharepoint2007, moss, wss3, sharepoint+2007